All went well to get the data from Jira REST API (Credit to @Tiago Machado) but couldn't connect to gateway to auto refresh data !!!
Error Message below
You can't schedule refresh for this data-set because the following data sources currently don't support refresh:
Thanks
CODE
let
// The same query as before
Source = Json.Document(Web.Contents("https://xxxxxx.atlassian.net/rest/api/2/search?jql=assignee=currentUser()")),
// Converting data from List to Table, so
#"Converted to Table" = Record.ToTable(Source),
// we will be able to transpose it
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
// and make the field names the column headers
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
// Now we are going to assign the correct data types for each column
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"expand", type text}, {"startAt", Int64.Type}, {"maxResults", Int64.Type}, {"total", Int64.Type}, {"issues", type any}}),
// And keep only the total column
#"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"total"}),
// Now we are going to get the first (and only) record and assign it to a variable named #"total"
#"total" = #"Removed Other Columns"{0}[total],
// Now it is time to build a list of startAt values, starting on 0, incrementing 100 per item
#"startAt List" = List.Generate(()=>0, each _ < #"total", each _ +100),
// Converting the startAt list into Table - not sure if this is really necessary
#"Converted to Table1" = Table.FromList(#"startAt List", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
// and renaming its single column
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table1",{{"Column1", "startAt"}}),
// Now let's create a new column URL with the URL we are interested at. Note the maxResults and startAt parameters this time
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "URL", each "https://xxxxxx.atlassian.net/rest/api/2/search?maxResults=100&jql=assignee=currentUser()&startAt=" & Text.From([startAt])),
// And finally retrieve them all
data = List.Transform(#"Added Custom"[URL], each Json.Document(Web.Contents(_)))
in
data
******************************
Credit to:
@Tiago Machado
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.