Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Transition issue when linked issued is being transitioned Edited

I want to transition issue when linked issue (epic) is being transition from "Open" to "In Development", then the issue (Issue type: Change) relates to will move to "In Development"

I have used the code below but the issue is not transitioning:
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Logger
import org.apache.log4j.Level

def log = Logger.getLogger("com.acme.CreateSubtask")

def issueService = ComponentAccessor.getIssueService()
def linkType = ["Relates"]
// 6.x validateTransition wants a User, so we have to use getDirectoryUser()
// 7.x validateTransition wants an ApplicationUser, so remove the .getDirectoryUser() after we upgrade
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def linkMgr = ComponentAccessor.getIssueLinkManager()
// Look through the outward links
log.debug("commence for loop")
for (IssueLink link in linkMgr.getOutwardLinks( {
log.debug("entered for loop")
def destIssue = link.getDestinationObject()
// Does the name of the link match "relates to" ?
if (linkType.contains( {
log.debug("relates to is the link type")
def destStatusObject = destIssue.getStatus()
// Is the status of the linked issue "Display" ?
if ( == "In Testing") {
// Prepare our input for the transition
log.debug("Status == Display")
def issueInputParameters = issueService.newIssueInputParameters()

{ setComment("Cancelled Vacation Request by HR") setSkipScreenCheck(true) }

// Validate transitioning the linked issue to "Signs Needed"
def validationResult = issueService.validateTransition(user,, 71, issueInputParameters)
if (validationResult.isValid()) {
log.debug("Validation Result is valid")
// Perform the transition
def issueResult = issueService.transition(user, validationResult)
if (! issueResult.isValid()) {
log.debug("Failed to transition task $

{destIssue.key}, errors: ${issueResult.errorCollection}")
} else {
log.debug("Could not transition task ${destIssue.key}

, errors: $


} else {
log.debug("Skipping link: $

{} ${destIssue.key} ${} (wrong status)")
} else {
log.debug("Skipping link: ${}



(wrong type)")

Please screenshot of the different workflows and its ID:

1 answer

Hello @Swarna Radha

As i can see your link type "relates to" not "Relates"

def linkType = ["Relates"]
def linkType = ["relates to"]

Hi @Mark Markov,

I have changes to 'relates to' still it is not transitioning.



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,894 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you