Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need assistance updating Power Bi query via REST API to list issues.

Richard Cieslik September 16, 2025

This is the pagination code I used with the (now) redacted API:

let
Source = Json.Document(Web.Contents("https://[company]",
[RelativePath="/rest/api/2/search",Query=[jql="project=TPS AND type = Story AND summary ~ OAC"],
Headers=[Authorization="Basic " & "TOKEN"]])),
totrecords = Source[total],
CurrentstartAtList = List.Generate(()=>0, each _ < totrecords, each _ +100),
//a= List.Transform(CurrentstartAtList, each """" & Text.From(_) & """"),

data = List.Transform(CurrentstartAtList, each Json.Document(Web.Contents("[Company]",
[RelativePath="/rest/api/2/search",
Query=[maxResults="100",startAt=Text.From(_),jql="project=TPS AND type = Story AND summary ~ OAC",fields = "assignee,created,parent,customfield_10153,creator,customfield_10015,customfield_10063,customfield_10042,customfield_10077,customfield_10051,customfield_10052,customfield_10048,customfield_10041,customfield_10024,transitiontype,description,issuetype,lastViewed,priority,progress,project,labels,resolution,resolutiondate,status,summary,timespent,updated,statuscategorychangedate"],
Headers=[Authorization="Basic " & "TOKEN"]]))),
#"Converted to Table1" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"issues"}, {"issues"}),
#"Expanded issues" = Table.ExpandListColumn(#"Expanded Column1", "issues"),

etc now working with the exported records.

However, that now fails, and I can't get it to work with the new API.

THIS successfully returns 50 records:

let
Source = Json.Document(Web.Contents("https://[Company]",
[RelativePath="/rest/api/3/search/jql?",Query=[jql="project=TPS AND type = Story",fields = "assignee,created,parent,issuelinks,customfield_10153,creator,customfield_10015,customfield_10063,customfield_10042,customfield_10077,customfield_10051,customfield_10052,customfield_10048,customfield_10041,customfield_10024,transitiontype,description,issuetype,lastViewed,priority,progress,project,labels,resolution,resolutiondate,status,summary,timespent,updated,statuscategorychangedate"],
Headers=[Authorization="Basic " & "TOKEN"]])),
issues = Source[issues]
in
issues

But I don't know the syntax needed to paginate.

Any help greatly appreciated!

1 answer

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2025

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events