I would like to make a transition of issue where the action "Create linked issue" is performed.
For example, I have an epic issue "epic issue 1" and its status "In-progress".
And an user clicks the button "Create linked issue" and Jira creates new issue named "Linked issue 1". After "Linked issue 1" is created by issue, then epic issue
"epic issue 1" should make a trancition to change its status from "In-progress" to "Code-review".
That is, what I want is when user creates linked issue from Epic issue, then make transition to "desired status" of Epic issue.
To do that I created a post function in Workflow of issue "Linked issue 1" and would like to read the all outward links and inwards links of issue. The code looks like this:
if(issue.getIssueType().name == 'Bug'
|| issue.getIssueType().name == 'New Feature'){
def issueManager = ComponentAccessor.issueManager
log.info('***** Current Status. Start: *****')
log.info('Issue: ' + issue + '. Issue Type: ' +
issue.getIssueType().getName())
log.info('***** Current Status. Finish: *****')
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
log.info('Start of Outward Links')
issueLinkManager.getOutwardLinks(issue.id).each{ issueLink ->
def linkedIssue = issueLink.getDestinationObject()
log.info('linkedIssue: ' + linkedIssue + ' . LinkedIssueType: '
+ linkedIssue.getIssueType().getName())
}
log.info('End of Outward Links')
log.info('Start of Inward Links')
issueLinkManager.getInwardLinks(issue.id).each{ issueLink ->
def linkedIssue = issueLink.getDestinationObject()
log.info('linkedIssue: ' + linkedIssue + ' . LinkedIssueType: '
+ linkedIssue.getIssueType().getName())
}
log.info('End of Inward Links')
}
However, what I see in Execution Information is ( there is no outward links and inwards links):
2018-07-04 13:24:01,033 INFO [workflow.ScriptWorkflowFunction]: ***** Current Status. Start: *****
2018-07-04 13:24:01,034 INFO [workflow.ScriptWorkflowFunction]: Issue: Test of Epic 6. Issue Type: New Feature
2018-07-04 13:24:01,034 INFO [workflow.ScriptWorkflowFunction]: ***** Current Status. Finish: *****
2018-07-04 13:24:01,034 INFO [workflow.ScriptWorkflowFunction]: Start of Outward Links
2018-07-04 13:24:01,035 INFO [workflow.ScriptWorkflowFunction]: End of Outward Links
2018-07-04 13:24:01,035 INFO [workflow.ScriptWorkflowFunction]: Start of Inward Links
2018-07-04 13:24:01,036 INFO [workflow.ScriptWorkflowFunction]: End of Inward Links
Guys, how is it possible to read outward links and inwards links of issue in post function?