-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathget-ServiceDeskIssuesDataFromJiraCloud.pq
66 lines (66 loc) · 2.78 KB
/
get-ServiceDeskIssuesDataFromJiraCloud.pq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
let
output =
(jiraTableApiURL as text,maxResFull as text,maxRespart as text) as table =>
let
//https://domain.atlassian.net
totalCounter =
Json.Document(
Web.Contents(
"https://domain.atlassian.net",
[
RelativePath=jiraTableApiURL,
Query=[maxResults=maxResFull]
]
)
)
[total],
tbl =
#table(
type table [
pageCounter = Int64.Type,
JIRA = record
],
List.Transform(
{1..Number.RoundUp(totalCounter / maxRespart)},
each
{
_,
Json.Document(
Web.Contents(
"https://domain.atlassian.net",
[
RelativePath=jiraTableApiURL,
Query=[
startAt=Text.From(((_ - 1) * maxRespart)),
maxResults=maxRespart
]
]
)
)
}
)
)
in
tbl,
documentation = [
Documentation.Name = " get-ServiceDeskIssuesDataFromJiraCloud.pq ",
Documentation.Description = " Getting all data of issues from JIRA CLOUD. For Authentication you need to use BASIC Authorization with your JIRA Email and generate API-Token as password. Generate API-Token is possible on https://id.atlassian.com/manage-profile/security ",
Documentation.Source = "https://www.jaknapowerbi.cz",
Documentation.Version = " 1.0 ",
Documentation.Author = " Štěpán Rešl ",
Documentation.Examples = {
[
Description = " Before using this function you have to change https://domain.atlassion.net to your DOMAIN ",
Code = " Input: ""rest/api/3/search"", ""1"",""100"" ",
Result = "#table"
]
}
]
in
Value.ReplaceType(
output,
Value.ReplaceMetadata(
Value.Type(output),
documentation
)
)