AssignIssue
jiraAssignIssue
This step assigns a particular issue to a user.
Input
- idOrKey - Issue id or key.
- userName - username of the person who should be added as a watcher.
- accountId - accountId of the person who should be added as a watcher. Only applicable for GDPR instances.
- site - Optional, default:
JIRA_SITE
environment variable. - failOnError - Optional. default:
true
.
Output
- Each step generates generic output, please refer to this link for more information.
- The api response of this jira_assign_issue step can be reused later in your script by doing
response.data.required_field_name
. - You can see some example scenarios here
- All the available fields for a jira response can be found in JIRA API documentation depending on your JIRA version.
Examples
-
With default site from global variables.
node { stage('JIRA') { jiraAssignIssue idOrKey: 'TEST-1', userName: 'Jenkins' } }
-
withEnv
to override the default site (or if there is not global site)node { stage('JIRA') { withEnv(['JIRA_SITE=LOCAL']) { jiraAssignIssue idOrKey: 'TEST-1', userName: 'Jenkins' } } }
-
Without environment variables.
jiraAssignIssue site: 'LOCAL', idOrKey: 'TEST-1', userName: 'Jenkins'
-
Aa empty userName and accountId will remove the assignee.
jiraAssignIssue site: 'LOCAL', idOrKey: 'TEST-1', userName: null