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

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.