Issue linked with "Automation" point to itself

Roman Glotov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 4, 2023

I'm using "Automation for Jira" for creating a documentation (DOC project) case while a dev ticket(APP project) transitions to "Verification needed" status:

2023-12-04_11h42_10.png

I also want to update some fields in this DOC case if the parent APP issue was re-opened and transitioned again to "Verification needed". For this I tried to make some ScriptRunner post-function and found a strange behavior -  the link which is created by Automation gives the parent issue instead of DOC case:

 

def issueManager = ComponentAccessor.getIssueManager()
def issueKey = "APP-36559"
def issue = issueManager.getIssueByCurrentKey(issueKey)
List<IssueLink> allOutIssueLink = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())
List<IssueLink> allInIssueLink = ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId())

// Combine both inward and outward links into one list
List<IssueLink> allIssueLinks = allInIssueLink + allOutIssueLink

allIssueLinks.each { issueLink ->
    def linkedIssue = issueLink.getDestinationObject()
    String type = linkedIssue.getProject().name
    log.warn(linkedIssue.key)
}
LOG:

2023-12-04 11:49:56,580 WARN [runner.ScriptBindingsManager]: APP-36559
2023-12-04 11:49:56,581 WARN [runner.ScriptBindingsManager]: APP-36319
2023-12-04 11:49:56,581 WARN [runner.ScriptBindingsManager]: CONF-527
2023-12-04 11:49:56,581 WARN [runner.ScriptBindingsManager]: AMS-1369
has anyone run into such issue and knows how to deal with it?

1 answer

0 votes
Roman Glotov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 5, 2023

By now resolved using ScriptRunner post-functions. If you need such solution - let me know.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events