Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Validator for Subtask to be Done before Parent can move to SME Review status

Mahnoor Arshad September 3, 2025

I have a subtask issue CM Review that needs to be set to Done before the parent issue 'Change Request' ticket can move to the next status 'SME Review'. Does anyone know what simple script I can write to achieve this?

Parent issue cannot move to 'SME Review' until sub-task issue is 'Done'. Other than that user will get an error message. 

4 answers

1 vote
Viktoriia Golovtseva _TitanApps_
Atlassian Partner
September 4, 2025

Hi @Mahnoor Arshad 

You can definitely achieve this behavior, but instead of writing a custom script, I’d recommend a more reliable and scalable solution using a checklist validator. If you try Smart Checklist for Jira, you can solve this elegantly by replacing the sub-task with a mandatory checklist item and then applying our Smart Checklist validator to block status transitions until the checklist item is completed.

How it works:

Smart Checklist offers a built-in workflow validator that checks whether all mandatory items in the checklist are marked as Done before allowing a transition. If any item is still open, the transition (e.g. from "Change Request" to "SME Review") will be blocked and an error message will appear.

This method ensures:

  • Sub-task logic is simplified into a checklist

  • Transitions are only allowed when required checklist items are completed

  • Admins can enforce immutability and control over what’s required

0 votes
Staffan Redelius
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2025

Hi @Mahnoor Arshad 

Just to add to what @Trudy Claspill describes above. You can add a condition directly in the workflow that all Sub-task needs to have a certain status before allowing the transition.

The drawback is that the user don't get any error message, the transition is just unavailable until the conditions are met which might cofuse users.

Skärmbild 2025-09-04 095716.png

Let me know if this is of any help!

Best regards,
/Staffan

Mahnoor Arshad September 4, 2025

@Staffan Redelius 

I have tried this option, however it will hide the transition from the user which is something I do not want in the process. And it would be a nice to have an error message appear. 

0 votes
Trudy Claspill
Community Champion
September 3, 2025

Hello @Mahnoor Arshad 

You mentioned that you are looking for a script. What apps do you have added to your Jira instance that supports adding scripts?

Without scripting tools, one possible solution is to have a custom field in the parent issue that is set only when the subtask is transitioned to Done. You could use an Automation Rule, triggered by the transition of the subtask, to set the field in the parent issue.

You could then add a Validator to the workflow transition for the parent to the SME Review status to check the content of that custom field.

Mahnoor Arshad September 4, 2025

Hi @Trudy Claspill 

I have Scriptrunner. I have written a simple scripted validator to help achieve this however it does not seem to be executing properly. 

 

Validator script.jpg

Trudy Claspill
Community Champion
September 4, 2025

Hello @Mahnoor Arshad 

Thank you for that additional information.

The tags on your post indicate that this question concerns Jira Cloud.

Can you confirm that this is for Jira Cloud versus Jira Data Center? The screen I have in my Jira Cloud instance for adding a ScriptRunner Scripted Validator to a workflow does not look like the image you provided.

Notice that mine has the field for the message above the scripting area.

Screenshot 2025-09-04 at 11.03.39 AM.png

0 votes
Matteo Vecchiato
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2025

Hi @Mahnoor Arshad .

Thank you for your question. Please consider the following doc from Adaptavist: https://docs.adaptavist.com/sr4jc/latest/features/workflow-extensions/jira-expression-examples  with Jira expressions and groovy script.

Other way is to "revert" the status through automation, but after have changed the status.

Hope it helps 

Regards 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events