I had thought a combination of the >3 JIRA plugins available would do this, but I"m getting stumped.
What I want:
In my pipeline, for the ticket IDs mentioned in the build (e.g. PROJ-1, PROJ-2, PROJ-xxx)
- set a custom field to a value
- transition those tickets thorough a jira workflow step
jira-plugin seems to maybe do this. This works for labels:
step([$class: 'hudson.plugins.jira.JiraIssueUpdater',
issueSelector: [$class: 'hudson.plugins.jira.selector.DefaultIssueSelector'],
scm: scm,
labels: [ "123", "Jenkins-Build" ] ]);
I was hoping this would work for fields
step([$class: 'hudson.plugins.jira.pipeline.IssueFieldUpdateStep', fieldId: '11780', fieldValue: '123', issueSelector: [$class: 'hudson.plugins.jira.selector.DefaultIssueSelector']])
However nothing seems to happen. No error, no update. Specifying a direct ticket ID doesn't seem to help either.
Some of the steps take issue selectors, some seem to have to specify the JQL directly (which is not useful in this instance). I was hoping
List<String> issueKeys = jiraIssueSelector();
Might do the trick, but it does not seem to return anything.
"jira workflow steps" seems to have nice features, but is of no use if I can't get the ticket list.
jira-ext-plugin seems also to have a 'determine what tickets' functionality, but it's not exposed for workflow (that I can tell). I've seen claims it adds an env variable, but I can't see any documentation to that effect.
Anyone achieved anything like this?