Transition Parent and linked issues status based on Sub-task status using script runner.

mani@123 September 11, 2019

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 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

mani@123 September 11, 2019

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 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)

mani@123 September 11, 2019

Thanks Leo.

I will try and update you

Suggest an answer

Log in or Sign up to answer