EditVersion
jiraEditVersion
Edit version based on given input, which should have some minimal information on that object.
Note: Sometimes it may not possible to directly edit version (rename it) without un tagging all of its current JIRAs.
TODO: probably we should try move version
Input
- id - version id. (Note: Applicable only from version 1.3.0)
- version - version to be edited.
- site - Optional, default:
JIRA_SITE
environment variable. - failOnError - Optional. default:
true
. - auditLog - Optional. default:
true
. Append the build url and build user name to the description.
Output
- Each step generates generic output, please refer to this link for more information.
- The api response of this jira_edit_version 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') { def testVersion = [ id: '1000', name: 'test-version', archived: true, released: true, description: 'desc', project: 'TEST' ] jiraEditVersion id: '1000', version: testVersion } }
-
withEnv
to override the default site (or if there is not global site)node { stage('JIRA') { withEnv(['JIRA_SITE=LOCAL']) { def testVersion = [ id: '1000', name: 'test-version', archived: true, released: true, description: 'desc', project: 'TEST' ] jiraEditVersion id: '1000', version: testVersion } } }
-
Without environment variables.
def testVersion = [ id: '1000', name: 'test-version', archived: true, released: true, description: 'desc', project: 'TEST' ] jiraEditVersion id: '1000', version: testVersion, site: 'LOCAL'