Is there any way to change the parent status on changing subtask status

please help

3 answers

0 vote

You'll need an add-on or code to do that.  There's nothing built into JIRA, except for the Software trick that can check when a parent has its last sub-task moved to done, and it moves the parent automatically.

Your code will need to check all the subtasks and then read the parent to check its status and issue the transition if it's appropriate.

0 vote

Hi Sudhakar

As @Nic Brough [Adaptavist] has said, JIRA does not have something in-built into it as of now. However, if you are on a standalone version of JIRA and you have script runner installed then you can traverse through the sub-tasks and check for the status and then invoke a transition.

To start off with, I think the below snippet will be useful.

 

Collection<Issue> subTaskList = subTaskManager.getSubTaskObjects(issue);
Resolution resolutionObj=issue.getResolutionObject();
if(resolutionObj != null && resolutionObj.getName().equals("<Current State>")){ // To check if the parent is in the state that you want.
boolean anysubtaskNotclosed = false;
for(Issue subTaskObj : subTaskList){
	Status subStatus = subTaskObj.getStatusObject(); 
	if(subStatus.getName().equals("<Status of Sub-Task>")==false{
		anysubtaskNotclosed = true;
		break;
}
}
 
if(!anysubtaskNotclosed)
{
	// Code to transition the parent to the state you want
}

 

Hope this helps.

 

Thanks

@Arun Thundyill Saseendran

You can also use the JIRA Misc Workflow Extension add-on which provides post functions to "transition parent issue" and "transition linked issues."

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

98 views 0 1
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you