cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Jira and Power BI

Dears,

 

I discovered that I couldn't connect to Jira using Power Bi Desktop. So, I found that I can only connect to jira through Power Bi Service which is available only on the Power BI Account on the web.

 

So, I have been trying to connect to Jira on the cloud, but it is only return 100 issues and doesn't retrive the projects that I am assigned to.

 

Any suggestions for solving this problem?

1 ACCEPTED SOLUTION

@Anonymous,

The JIRA content pack in Power BI Service relies on JIRA API. Based on the discussion, the 100 records limitation occurs on JIRA side.

In your scenario, please connect to JIRA PBIT I shared above, then change source code in Advanced Editor as discussed in this similar thread.

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

29 REPLIES 29
Jeanxyz
Super User
Super User

How can I connect Jira to Power BI service? Can someone share a printscreen?

ltopchyi
Helper III
Helper III

Hi,

You can also use Power BI Connector for Jira app to fetch Jira data (both Cloud and on-premise) to Power BI Desktop.

BR,

Liubov

Anonymous
Not applicable

Alternate approach is to use the code below to get all data using a JQL ( Please modify the query on basis of what data u want to fetch from JIRA )

 

let 
    BaseUrl = "https://jira.company.com/rest/api/2/search?jql=project in ('ABC') AND issuetype in subTaskIssueTypes()",

    JiraIDPerPage = 1000,
 
    GetJson = (Url) =>
        let 
            RawData = Web.Contents(Url),
            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"

I am new to Power BI and trying to get data from Jira Cloud. Can you point me where I need to go to place this code? I do not see anywhere in the desktop data connector for this code. Thanks.

Thanks a lot for sharing the script. 

After trying different filters, it finally works (see my code below). for credentials, I used basic authentification,email + API token. I have one question remains:  how to change the jql filter condition to include all projects? If I simply remove the filter condition, the Power Query seem to get stuck. 

@Anonymous , @dathompson @v-yuezhe-msft 

 

let
BaseUrl = "https://<company domain>.atlassian.net/rest/api/3/search?jql=project in ('WCH')",

JiraIDPerPage = 100,

GetJson = (Url) =>
let
RawData = Web.Contents(Url),
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"

I have copied the code to Power Query, for credentials, I used basic authentication with my email and API token, the credential seems to work, but Power Query couldn't fetch any data. Jira failure.PNG

Hello! Is it still working?
I received this error when trying to commect my company's Jira:

EugeniaBochko_0-1665573768334.png

 

Hi amkhullar,

hi all,

 

Thank you for sharing this code. It is really nice.

 

After I tried the query, the preview showes the results from Jira in pbi.

But if I want to save the dataflow, I got this error message "Can't Save Dataflow - One or more entities references a dynamic data source".

 

I used the same query from Jira and I tested and it works but I still can't save.

 

Does anyone have an idea?

amkhullar, I tried your code, but am getting the following error:

 

DataSource.Error: Web.Contents failed to get contents from 'https://imaginelearning.atlassian.net/rest/api/2/search?jql=filter=29555&maxResults=0' (400): 
Details:
    DataSourceKind=Web
    DataSourcePath=https://imaginelearning.atlassian.net/rest/api/2/search
    Url=https://imaginelearning.atlassian.net/rest/api/2/search?jql=filter=29555&maxResults=0
Anonymous
Not applicable

You need to write the JQL query instead of the filter statement :

 

jql=project in ('ABC') AND issuetype in subTaskIssueTypes()

 Whatever you have in your filter paste the complete query like I have done above. 

How to write JQL if I have to access data from all the projects assigned to me (10 projects data ) 

 

Thanks 

Anonymous
Not applicable

@Anonymous 

Does this still works for you ?

Pull works fine w\o the jql parm. When I give jql parm, keep getting the error.

"DataSource.Error: Web.Contents failed to get contents..."

The same pbi failing url works fine at a browser and the results are returned.

Thank you for your help! I tried again using your exact jql string except to use one of my own Jira project keys. But still no luck. And I've had similar code working not long ago, but not now. I wonder if something changed with Jira's rest api? Are you still able to run your query successfully?

 

DataSource.Error: Web.Contents failed to get contents from 'https://imaginelearning.atlassian.net/rest/api/2/search?jql=project%20in%20('PTL')%20AND%20issuetype%20in%20subTaskIssueTypes()&maxResults=0' (400): 
Details:
    DataSourceKind=Web
    DataSourcePath=https://imaginelearning.atlassian.net/rest/api/2/search
    Url=https://imaginelearning.atlassian.net/rest/api/2/search?jql=project%20in%20('PTL')%20AND%20issuetype%20in%20subTaskIssueTypes()&maxResults=0

 

Anonymous
Not applicable

Yes it works for me .

I tried your JQL but it seems to give error on the data u are sending as Params in it so please check Again and use the jql of your filter , below is the error I get using your link

{"errorMessages":["The value 'PTL' does not exist for the field 'project'.","Field 'issuetype' does not exist or this field cannot be viewed by anonymous users."],"warningMessages":[]}

I would suggest you go in your JIRA filter and try to use the same using as the query, you an also try using Postman to send the same URL and check the response.

It's working now! I was having an authentication issue, which I was able to troubleshoot and solve with Postman. Thank you for that suggestion. I also had to change JiraIDPerPage from 1000 to 100 to return the full dataset. 

 

Thank you again for sharing your code and for your help!

pchemes
Regular Visitor

Hi, tried connecting Jira Cloud in Power BI Web with the standard included app/connector, but no data is shown.  All labels loaded but no data.

Using this URL

https://xxxxxx.atlassian.net where xxxx is my domain

also tried adding the URL with the project name, like:

https://xxxxxx.atlassian.net/projects/AAA

but it never loads data to PBI.

Basic authentication works OK with a Token created in Jira and authentication works OK, actually in Jira it shows token was "used seconds ago".. and refresh in PowerBI shows OK, but all dashboard is empty, only column names are shown.

In Jira I have a lot of issues, and even a few assigned to myself, and I have several projects.

What should I check?

thanks!

JP

I am getting OLE DB, ODBC error while entering Jira link , please advice as the template doesn't work.

1) Current API call limit for JIRA connector issue is 100 only

2) Reduce the paginzation size to 100 in Advanced query editor

spawnian
Frequent Visitor

Link Expired please upload 😞

I eventually found the original JIRA content pack mentioned in the original solution. I have uploaded it to my google drive - https://drive.google.com/open?id=1rc7ngRHPH38AWwHEMKJ6mcPjhSVT-rJe. Hopefully you can download it.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors