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
Community moderators have prevented the ability to post new answers.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>> 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Conditioned validator is another option for your case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.