Auto-Close sub-tasks when Parent is closed

Hey all,

I am looking for a way to close all sub-tasks when the parent closes. I came across the Post Function here but I'm afraid it's not working for me.

We are on JIRA 5.0.2 with Script Runner 2.0.7

Any ideas?

4 answers

This widget could not be displayed.

"not working for me", it doesn't help us to help you!!

what is the error message you are getting on log file ?

This is the error: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: transientVars for class: Script4

Found a ticket on GRV [GRV-125] and tried Jamie's comment: I have no idea. Just for a test replace the line

String currentUser = ((WorkflowContext) transientVars.get("context")).getCaller();

with

String currentUser = ComponentManager.getInstance().getUserUtil().getUser("admin").getName()

In that string change admin to a user that has permission to do the transition.

Then I get this error: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: issue for class: Script23

This widget could not be displayed.
Henning Tietgens Community Champion Jan 08, 2014

Try to place the script at the end of the postfunctions list and tell us if this change anything.

It doesn't change anything

This widget could not be displayed.

Hello,

I'm using the same code from the example above (here) for default workflow (just testing ;) ) and instead of closed sub-tasks I've got sth like this:

groovy.lang.MissingPropertyException: No such property: a for class: Script2

I must admit that I am not best in 'grooving'- could anyone help me? I would really appreciate.

We are on JIRA 6.0.4 with Script Runner 2.1.17
Best wishes,
JW
This widget could not be displayed.
Andreas Knecht Community Champion Nov 21, 2016

There's now a very easy to configure way to transition parents and sub-tasks in sync using Automation for JIRA!

You can easily modify related issues (such as parents, stories, sub-tasks, epics, linked issues and even JQL) using our related issues action and condition:

(this example transitions sub-tasks to "In Progress", but you could easily change this to "Closed" as well)

For more details see https://blog.codebarrel.io/synchronize-parent-and-sub-task-issues-with-automation-for-jira-bdcca6c9d453

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

128 views 2 0
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