Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×com.onresolve.jira.groovy.groovyrunner
Hi All,
I am able to pick the issue and also the linked issue. Now I want to transition the linked issue based on the main issue.
I am written the below code to fetch the issue and the linked issue. Please assist me further to transition linked issue. My requirement is like project A has an issue and Project B has an issue. Project B's issue is cloned to Project A;s issue. So when the project A's issue moves to other state then automatically the B's issue status should also change.
class LinkedIssue extends AbstractIssueEventListener {
Logger log = Logger.getLogger(LinkedIssue.class)
@Override
void workflowEvent (IssueEvent event)
{
log.setLevel(org.apache.log4j.Level.DEBUG)
def itsdIssue
Issue issue = event.getIssue()
def issuestatus = issue.getStatusObject().getName().toUpperCase()
def issueType = issue.issueTypeObject.name
log.debug ("issue :" +issue);
log.debug ("issue ID :" +issue.id)
log.debug ("issue status:" +issuestatus);
log.debug ("issue Type: " +issueType);
def componentManager = ComponentManager.getInstance()
def issueLinkManager = componentManager.getIssueLinkManager()
def issueLink = issueLinkManager.getOutwardLinks(issue.id)
log.debug ("Linktype: " + issueLink.issueLinkType.name)
def linkedIssueObj = issueLink.destinationObject;
log.debug ("Issue Key: " + linkedIssueObj.key)
}
}
Here's a similar question which contains example script for transitioning linked issues
https://answers.atlassian.com/questions/183942/groovy-script-for-linked-issue-transition
Hope it helps
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.