Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
dude95
Resolver I
Resolver I

Jira API - Authorization using Key not working

Trying to pull information off of Jira for the web.  Looks like Atlasian no longer does user id/password authentication - all of the answers I found seem to be either older and using that method or incomplete.

 

What I understand - a token must be generated in base64 that combines user email and api token from Jira.  I do that with this code

 

 

let
    Source = User&":"&Token,
    Bytes = Text.ToBinary(Source),
    TextForm = Binary.ToText(Bytes, BinaryEncoding.Base64 )
in
    TextForm

 

 

Then I execute the API with this (that I just pulled from another thread)

 

let 
    BaseUrl = "https://titanpm.atlassian.net/rest/api/3/search?jql=project in ('Titan Solutions')",
    JiraIDPerPage = 1000,
 
    GetJson = (Url) =>
        let 
            RawData = Web.Contents(Url,[Headers=[Authorization="Basic " & Credentials ]]),
            Json    = Json.Document(RawData)
        in  Json,
 
    GetJiraIDCount = () =>
        let Url   = BaseUrl & "&maxResults=0",
            Json  = GetJson(Url),
            Count = Json[#"total"]
        in  Count,
 
    GetPage = (Index) =>
        let Skip  = "&startAt=" & Text.From(Index * JiraIDPerPage),
            Top   = "&maxResults=" & Text.From(JiraIDPerPage),
            Url   = BaseUrl & Skip & Top,
            Json  = GetJson(Url),
            Value = Json[#"issues"]
        in  Value,
 
    JiraIDCount = List.Max({ JiraIDPerPage, GetJiraIDCount() }),
    PageCount   = Number.RoundUp(JiraIDCount / JiraIDPerPage),
    PageIndices = { 0 .. PageCount - 1 },
    Pages       = List.Transform(PageIndices, each GetPage(_)),
    JiraID    = List.Union(Pages),
    Table       = Table.FromList(JiraID, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(Table, "Column1", {"id", "key", "fields"}, {"Column1.id", "Column1.key", "Column1.fields"})
in
    #"Expanded Column1"

 

The problem is credentials on the data source itself.  Power BI gives an error for anonymous access (with the key in the code)

Screenshot 2021-11-26 145057.jpg

 

I know I can't use user ID and password anymore?  What should I be using to get through here???

 

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @dude95 

 

You can follow the steps of this blog:

Connecting Jira to Power BI: 3 Easy Steps

Step 1: Generate an API Token

Step 2: Download and Install the JIRA Content Pack

Step 3: Add the API Token to the Jira Power BI Content Pack

  • Use your email address as your username and the new API Token as your password.

 

Now, you can use an API key (Manage API tokens for your Atlassian account ) instead of the password.

Link to deprecation notice: Deprecation notice - Basic authentication with passwords and cookie-based authentication 

 

 

Here are some references:

Guide:

Accessing Jira from Power BI

How to Set up a Power BI Jira Integration: The Complete 2021 Guide

Threads:

Unable to connect Jira to PBI

Connecting Jira to Power BI using the Web API

Jira and Power BI

REST API

Manage API tokens:

Manage API tokens for your Atlassian account

 

 

Best Regards,
Community Support Team _ Zeon Zheng

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-angzheng-msft
Community Support
Community Support

Hi, @dude95 

 

You can follow the steps of this blog:

Connecting Jira to Power BI: 3 Easy Steps

Step 1: Generate an API Token

Step 2: Download and Install the JIRA Content Pack

Step 3: Add the API Token to the Jira Power BI Content Pack

  • Use your email address as your username and the new API Token as your password.

 

Now, you can use an API key (Manage API tokens for your Atlassian account ) instead of the password.

Link to deprecation notice: Deprecation notice - Basic authentication with passwords and cookie-based authentication 

 

 

Here are some references:

Guide:

Accessing Jira from Power BI

How to Set up a Power BI Jira Integration: The Complete 2021 Guide

Threads:

Unable to connect Jira to PBI

Connecting Jira to Power BI using the Web API

Jira and Power BI

REST API

Manage API tokens:

Manage API tokens for your Atlassian account

 

 

Best Regards,
Community Support Team _ Zeon Zheng

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.