-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
58 lines (53 loc) · 1.59 KB
/
build.gradle
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
import java.net.URLEncoder
import groovy.json.JsonOutput
apply from: 'gradle/http.gradle'
ext {
jiraBaseUrl = 'https://epages.atlassian.net/rest/api/2'
jiraUser = [ "${jiraUsername}": "${jiraPassword}" ]
buildJiraUrl = { urlPath -> jiraBaseUrl + urlPath }
jiraIds = [
'Integrated in Cluster Version': 'customfield_12972',
'Agile Development': '11830',
'New Feature': '2'
]
}
task getIssueData {
group 'JIRA'
description 'Get data for JIRA issues'
ext {
issues = project.getProperty('issueIds')
templateFile = file 'templates/jiratasks.tmpl.js'
outputFile = file 'scripts/jiratasks.js'
}
doLast {
def response = httpRequest(
user: jiraUser,
url: buildJiraUrl('/search'),
method: 'GET',
query: [
jql: URLEncoder.encode("id in (${issues})")
]
)
def transformedIssues = response.issues.collect {
[
id: it.key,
name: it.fields.summary,
type: it.fields.issuetype.name,
summary: '',
priority: it.fields.priority.name,
integrated: it.fields.customfield_12972?.value,
platform: 'ePages6',
links: []
]
}
copy {
from 'templates/jiratasks.tmpl.js'
into 'scripts'
rename { 'jiratasks.js' }
expand([ issuesAsJson: JsonOutput.prettyPrint(JsonOutput.toJson(transformedIssues)) ])
}
}
}
wrapper {
gradleVersion = '4.2'
}