LinkIssues
jiraLinkIssues
This step links two issues in the provided JIRA site.
Hint: Try getIssueLinkTypes to know the type.
Input
- type - type of the link. (Ex: Relates, Blocks, Cloners, Duplicate)
- inwardKey - inward issue key.
- outwardKey - outward issue key.
- site - Optional, default: JIRA_SITEenvironment 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_link_issues 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') { jiraLinkIssues type: 'Relates', inwardKey: 'TEST-1', outwardKey: 'TEST-2' } }
- 
withEnvto override the default site (or if there is not global site)node { stage('JIRA') { withEnv(['JIRA_SITE=LOCAL']) { jiraLinkIssues type: 'Relates', inwardKey: 'TEST-1', outwardKey: 'TEST-2' } } }
- 
Without environment variables. jiraLinkIssues type: 'Relates', inwardKey: 'TEST-1', outwardKey: 'TEST-2', site: 'LOCAL'