I'm shifting from maven jobs to pipeline jobs. in maven jobs we have used Jira update relevant issues
plugin in post build actions step which will update the jenkins current build status to all the jira issues mentioned in the commits messages.
I'm trying to implement the same in pipeline script, i did tried something like below but it didn't help.
stage('Jira: Update relevant issues') {
steps {
script {
try {
step([$class: 'hudson.plugins.jira.JiraIssueUpdater',
issueSelector: [$class: 'hudson.plugins.jira.selector.DefaultIssueSelector'],
scm: [$class: 'GitSCM', branches: [[name: '<branch name>']],
userRemoteConfigs: [[url: '<clone url>']]]])
} catch (Exception e) {
echo "Error updating Jira issues: ${e}"
}
}
}
}
and i have installed multiple jira plugins in my jenkins env and tried using pipeline steps to utilize it, but no joy.
Note: I did notice that everywhere in piplescript they were mentioning the jira issue id/key, but here whatever the commit changes triggered the jenkins build will have jira ticket in commit message. All those jira tickets should have updated with the build status in its comment section.