Skip to content

Commit df24ab3

Browse files
committed
ci: populate jira branch custom field from pipeline
1 parent db380ef commit df24ab3

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

Jenkinsfile

+23-5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,29 @@ pipeline {
3131
}
3232

3333
stages {
34+
stage('Pull Request') {
35+
agent any
36+
when {
37+
expression {
38+
env.BASE_BRANCH.startsWith("PROVIDER-")
39+
}
40+
}
41+
steps {
42+
// Update Jira Ticket Custom fields
43+
script {
44+
// customfield_10126 - Merge Request
45+
// customfield_10159 - Branch
46+
def fields = [
47+
fields: [
48+
customfield_10126: env.JOB_BASE_NAME,
49+
customfield_10159: env.CHANGE_BRANCH,
50+
]
51+
]
52+
jiraEditIssue site: 'irontec.atlassian.net', idOrKey: env.JIRA_TICKET, issue: fields
53+
}
54+
}
55+
}
56+
3457
// --------------------------------------------------------------------
3558
// Image stage
3659
// --------------------------------------------------------------------
@@ -651,11 +674,6 @@ pipeline {
651674
println "No functional reviewer assigned."
652675
}
653676

654-
// Link issue Pull Request field with current branch
655-
// customfield_10126 - Pull Request
656-
def fields = [fields: [customfield_10126: env.JOB_BASE_NAME]]
657-
jiraEditIssue site: 'irontec.atlassian.net', idOrKey: env.JIRA_TICKET, issue: fields
658-
659677
// Validated - 10325
660678
def status = issue.data.fields.status
661679
println "Issue Status: ${status.name} (${status.id})"

0 commit comments

Comments
 (0)