Not able to schedule the dataset refresh in Power BI for Jira Reports

Viewed 803

While trying to schedule the dataset refresh for my Power BI Jira report (I am using Power BI Desktop for building the report and getting published to my Power BI account).

I am getting below error:

You can't schedule refresh for this dataset because the following data sources currently don't support refresh:
Data source for Query1

When I checked my "Data Source Settings" I can see the warning saying Some data sources may not be listed because of hand-authored queries

Here is my Power BI Query:

        let 
Source = Json.Document(Web.Contents(JIRA_URL,[RelativePath="/rest/api/2/search",Query=[jql=& TESTCASE_QUERY]])), 
#"Converted to Table" = Record.ToTable(Source), 
#"Transposed Table" = Table.Transpose(#"Converted to Table"), 
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]), 
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"expand", type text}, {"startAt", Int64.Type}, {"maxResults", Int64.Type}, {"total", Int64.Type}, {"issues", type any}}), 
#"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"total"}), 
#"total" = #"Removed Other Columns"{0}[total], 
#"startAt List" = List.Generate(()=>0, each _ < #"total", each _ +100), #"Converted to Table1" = Table.FromList(#"startAt List", Splitter.SplitByNothing(), null, null, ExtraValues.Error), 
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table1",{{"Column1", "startAt"}}), 
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "URL", each JIRA_URL & "/rest/api/2/search?maxResults=100&jql=" & TESTCASE_QUERY & "&startAt=" & Text.From([startAt])), data = List.Transform(#"Added Custom"[URL], each Json.Document(Web.Contents(_))), 
#"Converted to TableQuery" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error), 
#"Expanded ColumnIssues" = Table.ExpandRecordColumn(#"Converted to TableQuery", "Column1", {"issues"}, {"issues"}), 
#"Expanded issues" = Table.ExpandListColumn(#"Expanded ColumnIssues", "issues"), 
#"Expanded issues1" = Table.ExpandRecordColumn(#"Expanded issues", "issues", {"id", "key", "fields"}, {"id", "key", "fields"}) in 
#"Expanded issues1"

I tried using the relative path as well, however, not able to solve this issue. Is it because I have used one more query inside as well #"Added Custom" = Table.AddColumn(#"Renamed Columns", "URL", each JIRA_URL & "/rest/api/2/search?maxResults=100&jql=" & QUERY & "&startAt=" & Text.From([startAt])), data = List.Transform(#"Added Custom"[URL], each Json.Document(Web.Contents(_))),

What could be best solution.

I was able to fix the above issue in my PowerBI desktop with below sample code

    let 
Source = Json.Document(
            Web.Contents(JIRA_URL,
            [
                RelativePath="rest/api/2/search",
                Query=
                [
                  maxResults="100",
                  jql= EPICS_QUERY,
                  startAt="0",
                  apikey="MjY0MzgyODgyNDg4OnRnBcfBqhio"
                ]
            ]
)),

numIssues = Source[total],

startAtList = List.Generate(()=>0, each _ < numIssues, each _ +100),
 
data        = List.Transform(startAtList, each Json.Document(Web.Contents(JIRA_URL,
            [
            RelativePath="rest/api/2/search",
            Query=
                [
                  maxResults="100",
                 jql=EPICS_QUERY,
                 startAt=Text.From(_),
                  apikey="MjY0MzgyODgyNDg4OnRnBcfBqhio"
                ]
            ]))),

 iLL = List.Generate(
     () => [i=-1, iL={} ],
     each [i] < List.Count(data),
     each [
         i = [i]+1,
         iL = data{i}[issues]
     ],
     each [iL]
 ),
 // and finally, collapse that list of lists into just a single list (of issues)
 issues = List.Combine(iLL), 
 #"Converted to Table" = Table.FromList(issues, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
 #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"key", "fields"}, {"issue", "fields"}),
 #"Expanded fields" = Table.ExpandRecordColumn(#"Expanded Column1", "fields", {"assignee", "created", "creator", "description", "issuetype", "parent", "priority", "project", "reporter", "resolution", "resolutiondate", "status", "summary", "updated"}, {"assigneeF", "created", "creatorF", "description", "issuetypeF", "parentF", "priorityF", "projectF", "reporterF", "resolutionF", "resolutiondate", "statusF", "summary", "updated"}),
 #"Expanded assignee" = Table.ExpandRecordColumn(#"Expanded fields", "assigneeF", {"key"}, {"assignee"}),
 #"Expanded creator" = Table.ExpandRecordColumn(#"Expanded assignee", "creatorF", {"key"}, {"creator"}),
 #"Expanded issuetype" = Table.ExpandRecordColumn(#"Expanded creator", "issuetypeF", {"name"}, {"issuetype"}),
 #"Expanded priority" = Table.ExpandRecordColumn(#"Expanded issuetype", "priorityF", {"name"}, {"priority"}),
 #"Expanded project" = Table.ExpandRecordColumn(#"Expanded priority", "projectF", {"key"}, {"project"}),
 #"Expanded reporter" = Table.ExpandRecordColumn(#"Expanded project", "reporterF", {"key"}, {"reporter"}),
 #"Expanded resolution" = Table.ExpandRecordColumn(#"Expanded reporter", "resolutionF", {"name"}, {"resolution"}),
 #"Expanded status" = Table.ExpandRecordColumn(#"Expanded resolution", "statusF", {"name"}, {"status"}),
 #"Changed Type" = Table.TransformColumnTypes(#"Expanded status",{{"created", type datetimezone}, {"resolutiondate", type datetimezone}, {"updated", type datetimezone}}),
 #"Expanded parentF" = Table.ExpandRecordColumn(#"Changed Type", "parentF", {"key"}, {"parent"})
in
 #"Expanded parentF"
0 Answers
Related