Hello!
I have an issue A on a JIRA instance A that is linked to an issue B1 on an instance B.
I have an issue B2 on instance B that is linked to issue B1.
With a scripted post-function on a transition of the B2 issue workflow, I would like to automatically link issue B2 to issue A.
With the script I use, I can get the B1 issue id.
But with B1 issue id I can't get A issue id.
Here is the script I am using for development, at this point I am just trying to get the ids of issues B1 and A, and print them in issue B2 summary:
import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def authenticationContext = ComponentAccessor.getJiraAuthenticationContext()
issueLinkManager.getOutwardLinks(issue.getId()).each {
issueLink ->
if (issueLink.getIssueLinkType().getName().contains('Tests')) {
def idReq = issueLink.getDestinationObject()
issue.summary = 'GRT1 - ' + idReq.getKey() + ' - ' + issue.summary
issueLinkManager.getOutwardLinks(idReq.getId()).each {
reqlink ->
def idBSL = reqlink.getDestinationObject()
issue.summary = 'GRT2 - ' + idBSL.getKey() + ' - ' + issue.summary
}
}
}
Versions:
- A JIRA instance = 6.1.2
- A JIRA instance Script Runner = 3.0.10
- B JIRA instance = 7.2.6
- B JIRA instance Script Runner = 4.3.16
Many thanks for your help,
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.