Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

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?

  • Anonymous's avatar
    Anonymous
    8 years ago

    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

35 Replies

  • Anonymous's avatar
    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"
    • dathompson's avatar
      dathompson
      Frequent Visitor

      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's avatar
        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. 

    • dgold123's avatar
      dgold123
      Frequent Visitor

      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?

    • Anonymous's avatar
      Anonymous
      Not applicable

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

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Lydia Anonymous

       

      Thanks for your reoly.

       

      The problem is the connection retrieves only 100 records and we have more than 1600 record!

       

      Regards

      Seraj

      • Anonymous's avatar
        Anonymous
        Not applicable

        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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi ,

       

      The link you shared to download Power BI JIRA template file got expired. Can you please upload and share it again?.

       

      Thank you,

      Malar

    • ShankarNayinala's avatar
      ShankarNayinala
      New Member

      Hi,

      The PBIT is super useful and thank you very much for sharing. However, I want to ask how we can extract the sprint number. The PBIT has all the information needed except the Sprint number. 

      Thank you in advance.

      • ShankarNayinala's avatar
        ShankarNayinala
        New Member

        Hi,

        The PBIT is super useful and thank you very much for sharing. However, I want to ask how we can extract the sprint number. The PBIT has all the information needed except the Sprint number. 

        Thank you in advance.

  • pchemes's avatar
    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

    • Anonymous's avatar
      Anonymous
      Not applicable

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

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

    • pnl0cg5s's avatar
      pnl0cg5s
      New Member

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

  • Jeanxyz's avatar
    Jeanxyz
    Icon for Power Participant rankPower Participant

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

  • Anonymous, Jeanxyz 
    Thank you guys for providing the code and help. 
    I'm working on a similar project in PBI, where I used to connect Jira with Power BI and successfully get the relevant data. However, I have two issues: -

    1.  While using the below-mentioned code, the result is giving 3-time duplicates (I'm expecting to get 242 rows, but end result is 726 rows). Can you please guide me on how to change this code to get the right result rather than duplicates?

     

     

    let
    BaseUrl = "https://(Company domain)/rest/api/2/search?jql=project="Project name"&startAt=0&maxResults=1000",
    
    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"​

     

    2. Is it possible to make an auto-refresh functionality for this code, I have uploaded the report to the server and got an error while trying to make an auto-refresh. "This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. Learn more: https://aka.ms/dynamic-data-sources. Data source for Query1"

    Can you please guide me on these two topics? 

    Thank you for your support.

    Regards,

    Ahsan

     

    Ahmedx , amitchandak , lbendlin , you guys can also support if used to work on this type of data. Thanks.