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

Script Runner Transition parent issue based on linkedissues

We are trying to get a Feature to automatically transition to 'In Progress', when one or all of the linked issues are also transitioned.

1 answer

Hi Karl, 

Assuming that the Feature should transition into In Progress status when the linked issue transitions from [To Do - In Progress], you may set up a Custom script post-function at this transition step.

There's a sample script in the Adaptavist Library that you may adapt to your use case: Transition an Issue using Issue Input Parameters

I modified it to fit your requirements, maybe not exactly but you may try this out. Also, I'm unsure if your issue can have multiple Features linked to/from it. However, this script takes that into consideration. 

You can test this script in the Script Console & change it up as needed:

import com.atlassian.jira.component.ComponentAccessor

def issueLinkManager = ComponentAccessor.issueLinkManager
def workflowManager = ComponentAccessor.workflowManager
def issueService = ComponentAccessor.issueService
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser

// test issue - remove the following line when implementing post-function script
//def issue = ComponentAccessor.issueManager.getIssueObject('TEST-1')

// the name of action used to transition Feature(s)
final actionName = 'In Progress'

// the corresponding workflow id
def actionId = workflowManager.getWorkflow(issue).allActions.findByName(actionName)?.id
log.warn "actionId: " + actionId

// the name of the issue link type (taking into account the link direction - inward/outward)
final issueLinkName = 'Relates'

// if it's a Feature that's transitioning, don't run this script
if ( == 'Feature') {

// find the Feature(s) linked to/from this issue
def featureInward = issueLinkManager.getInwardLinks( { == issueLinkName }?.sourceObject
def featureOutward = issueLinkManager.getOutwardLinks( { == issueLinkName }?.destinationObject
def features = featureInward + featureOutward
log.warn "featureInward: " + featureInward
log.warn "featureOutward: " + featureOutward
log.warn "features: " + features

features.each { feature ->

def issueInputParameters = issueService.newIssueInputParameters()

def transitionValidationResult = issueService.validateTransition(user, feature?.id, actionId, issueInputParameters)
assert transitionValidationResult.isValid(): transitionValidationResult.errorCollection

def transitionResult = issueService.transition(user, transitionValidationResult)
assert transitionResult.isValid(): transitionResult.errorCollection

I hope that this helps!

If this response has answered your question, please do mark it as Accepted to make it easier for other users to discover potential solutions to their questions.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

90 views 0 1
Read article

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