I'm using "Automation for Jira" for creating a documentation (DOC project) case while a dev ticket(APP project) transitions to "Verification needed" status:
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.