Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Block subtask transition based on parent´s status

Hans-Hermann Hunfeld May 12, 2014

I would like to block a subtask transition via conditions (in order to allow only for admins but not assignee etc) based on the status of its parent.
In our usecase we set the parent to "waiting for customer" which triggers all subtasks which are "In Progress" to "On Hold". This subtasks should be allowed to restart progress as long as the parent is in the mentioned status...

I have installed some plugins for such requirements (Misc workflow extensions & script runner) but right now i do not now how to setup the according groovy expression as example...

Thanks for any help!
Hans-Hermann

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
JamieA
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.
May 12, 2014

Not tested but try:

! issue.isSubTask() || issue.parentObject.statusObject.name == "In Progress" || isUserMemberOfRole("Administrators")

The first part (issue.isSubTask) is to allow you to use the same workflow on parent and children.

It lets members of the Admins role override the restriction about the parent status.

Hans-Hermann Hunfeld May 12, 2014

Hey Jamie,

many thanks! Your suggestion was right (although i changed it a bit to keep role membership seperatly:

issue.parentObject.statusObject.name != "Waiting for Customer"

This made my day! :-)

Thanks & regards,
Hans-Hermann

0 votes
Hans-Hermann Hunfeld May 12, 2014

Thanks for the comments, but i don t think that i have to buy additional plugins for this requirement.

Any further ideas how to define the groovy expression? I tried something like this

parentIssue.issueTypeObject.status != 'Waiting for Customer'

but this expression never turns to true in order allow transition...

0 votes
Vidic Florjan
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.
May 12, 2014

>> based on the status of its parent.

You can also try to use "Condition based on regular expression" workflow Condition (with "Parent's issue status" field) of the JIRA Workflow Toolbox plugin.

And here is link to answer prepared with Scriptrunner for similar question: https://answers.atlassian.com/questions/243704/script-runner-validation-of-parent-field-jql-script

Hans-Hermann Hunfeld May 12, 2014

Hi Vidic,

thanks for your reply, but after checking the code i think the usecase is somehow different. I tried some stuff based on your linked question but without success...

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
May 12, 2014

Conditioned validator is another option for your case.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events