Skip to content

Commit f86e632

Browse files
committed
Add jql parameter to report API for filtering Jira tickets to update with test results
1 parent 2a40d78 commit f86e632

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Full plugin configuration below, optional properties can be omitted
1818
```groovy
1919
buildscript {
2020
dependencies{
21-
classpath group: 'com.assertthat.plugins', name: 'assertthat-bdd-gradle-tasks', version: '1.6'
21+
classpath group: 'com.assertthat.plugins', name: 'assertthat-bdd-gradle-tasks', version: '1.7'
2222
}
2323
}
2424
@@ -75,6 +75,8 @@ task submitReport(type: ReportTask){
7575
type = "cucumber"
7676
/*Optional - Run metadata */
7777
metadata="""{"env ":"uat ","build":"456"}"""
78+
/*-Optional - all Jira tickets will be updated with test results by default; when JQL is provided only filtered tickets will be updated*/
79+
jql = "project = XX AND key in ('XXX-1')"
7880
}
7981
8082
```

src/main/groovy/ReportTask.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ class ReportTask extends DefaultTask {
6767
@Input
6868
@Optional
6969
String metadata = null
70+
@Input
71+
@Optional
72+
String jql = null
7073

7174
@TaskAction
7275
def submitReport() {
@@ -81,7 +84,7 @@ class ReportTask extends DefaultTask {
8184
proxyUsername,
8285
proxyPassword,
8386
null,
84-
null,
87+
jql,
8588
type,
8689
jiraServerUrl,
8790
metadata,
@@ -92,7 +95,7 @@ class ReportTask extends DefaultTask {
9295
Long runid = -1L
9396
for (String f : files) {
9497
try {
95-
runid = apiUtil.upload(runid, arguments.getRunName(), arguments.getJsonReportFolder() + f, type, arguments.getMetadata())
98+
runid = apiUtil.upload(runid, arguments.getRunName(), arguments.getJsonReportFolder() + f, type, arguments.getMetadata(), arguments.getJql())
9699
} catch (IOException e) {
97100
throw new MojoExecutionException("Failed to upload report", e)
98101
} catch (JSONException e) {

0 commit comments

Comments
 (0)