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 Parent and linked issues status based on Sub-task status using script runner.

Hello All,

I am using below script to change parent issues transition when linked issue transition changes.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue

if( issue.getIssueType().getName().equals("Story"))
{
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
issueLinkManager.getOutwardLinks(issue.getId()).each {
issueLink ->
MutableIssue linkIssue = issueLink.getDestinationObject() as MutableIssue
log.info(linkIssue.getIssueType())
log.info(linkIssue.getIssueType().getName())
log.info(linkIssue.key)
linkIssue.setStatusId("10306")
linkIssue.store()
}

}

I want to change the Parent and linked issues transition based on sub-task transition.

For Example:

If Feature has 2 Sub-tasks and 3 stories linked to it. When sub-task status changed to In-Progress, parent and linked Statuses should also change to In-Progress status.

Thanks in advance,

Mani

1 answer

0 votes
Leo Community Leader Sep 11, 2019

Hi mani@123,

 

If you go with JSU plugin, it offers linked/parent issue transition as post function

or if you want to go with scriptrunner there are similar posts already

you can find them here Post1 and Post2 

 

Regards,

Leo

Hi Leo,

Thanks for the response.

The script runner links which you shared is describing only sub-task and parent transitions. But i want move parent and linked issue status automatically when sub-task transition changes.

I have also tried with JSU linked issue transition post function. However, when the sub-task transition changes only parent issue transition is changing but not linked issues.

Leo Community Leader Sep 11, 2019

Well it's not a surprise. at a time you can make a single post function

for your requirement, you'll have to add 2 post functions in a single transition

1. function to transition parent based on sub-task

2. function to transition linked issues based on story/parent

Make sure order is right(sub-task should be top of linked function if they share a common workflow)

Thanks Leo.

I will try and update you

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

865 views 6 24
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