cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Obtenga datos de la API de JIRA e importe en Power BI con Pagination

El mejor enfoque es utilizar el código siguiente para obtener todos los datos utilizando un JQL (Modifique la consulta sobre la base de qué datos desea obtener de JIRA )

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

    JiraIDPerPage á 1000,
 
    GetJson (Url) ?>
        let 
            RawData ? Web.Contents(Url),
            Json ?    Json.Document(RawData)
        en  Json,
 
    GetJiraIDCount () ?>
        let Url ?   BaseUrl & "&maxResults?0",
            Json ?  GetJson(Url),
            Count ? Json[-"total"]
        let Skip á  "&startAt"" & Text.From(Index * JiraIDPerPage),
            Top á   "&maxResults" & Text.From(JiraIDPerPage),
            Url -   BaseUrl & Skip & Top,
            Json -  GetJson(GetJson(Url),
            Value á Json[-"issues"]
        en  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),
    "Columna expandida1" - Tabla.ExpandRecordColumn(Tabla, "Columna1", "id", "clave", "campos", "Column1.id", "Column1.key", "Column1.fields" )
en
    "Columna expandida1"

1 ACCEPTED SOLUTION

Sí Compartirlo para otras personas beneficio.

View solution in original post

2 REPLIES 2
Resident Rockstar
Resident Rockstar

Hola @amkhullar ,

¿Esto es un intercambio?

Saludos

Cereza

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sí Compartirlo para otras personas beneficio.

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors