2017-07-15 38 views

回答

0

使用power bi內容包創建項目關鍵參數並在當前值中輸入項目關鍵字。項目關鍵字是預設問題類型編號的文本條。例如ZZZ-1096。然後將其添加到fetchpages功能 像這樣= (url as text, pageSize as number, optional projectKey as text) => let Source = GenerateByPage( (previous) => let skipRows = if previous = null then 0 else Value.Metadata(previous)[skipRows], 這就是來自here的電源bi連接器。

0

我有同樣的問題,並不得不添加幾個步驟來@Nick Chopper的答案讓它工作,但我使用模板的原始JIRA實例。步驟: -

步驟1:添加'projectKey'參數,類型爲文本並在當前值字段中輸入您的項目鍵。

步驟2:將projectKey參數添加到FetchPages函數並將此參數傳遞給FetchPage函數。

let 
    FetchPages = (url as text, pageSize as number, projectKey as text) => 
let 
Source = GenerateByPage(
(previous) => 
let 
    skipRows = if previous = null then 0 else Value.Metadata(previous)[skipRows], 
    totalItems = if previous = null then 0 else Value.Metadata(previous)[total], 
    table = if previous = null or Table.RowCount(previous) = pageSize then 
       FetchPage(url, pageSize, skipRows, projectKey) 
    else null 
in table, 

type table [Column1]) 
in 
    Source 
in 
    FetchPages 

第3步:在FetchPage函數中添加projectKey參數並將projectKey作爲jql查詢傳遞給JIRA Web服務。

let 
    FetchPage = (url as text, pageSize as number, skipRows as number, projectKey as text) as table => 
    let 
     //Here is where you run the code that will return a single page 
     contents = Web.Contents(URL&"/rest/api/2/search",[Query = [maxResults= Text.From(pageSize), startAt = Text.From(skipRows), jql = "project="&projectKey]]), 
     json = Json.Document(contents), 
     Value = json[issues], 
     table = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error) 
    in 
     table meta [skipRows = skipRows + pageSize, total = 500] 
in 
    FetchPage 

第4步:刷新你的數據

相關問題