"if all subtasks are done move also the parent issue"
Hello
I need your help,
we are using Jira cloud and we have installed addon called JMWE
I am trying to without success, can you help me?
I need to know what to select for post function (Transition parent issue )
and what to write in the condition field
{{Issuetype == sub-task | Status == Reviewed }} but how do i say "IF ALL SUBTASKS have status = X then move Parent issue (user story) to status =X" ???
thank you very much
Hi,
The most common approach to this requirement is actually to use a transition parent issue post-function on the sub-tasks' Close transition without conditional execution, and add a"sub-tasks blocking condition" on the Close transition of main issues to prevent them from being closed until all their sub-tasks are closed.
Note that this works just fine if issues and their sub-tasks share the same workflow.
Would that work for you?
Hello, Thanks for the reply but that does not help me with my problem
"IF ALL SUBTASKS have status = X then move Parent issue (user story) to status =X" ???
They dont share the same workflow and the status is not for closed it is from To DO to In priogress and this should slove it for all states
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it does.
First of all, I did mention two workflows in my explanation, I just added that it will also work if the two workflows are the same.
Then, it will try to trigger the transition on the parent even time a subtask is transitioned by the subtasks blocking condition on the parent transition will block the transition unless the subtasks are all in the desired status. Which is exactly what you need.
Also, you can obviously replace "Closed" with any other status - in your case "in progress".
Can you try that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What do you mean by "this should solve it for all states"? Do you want this implementation in all the transitions? If yes, you can add the Transition parent issue post-function to the transition on the Sub-task workflow with a conditional execution. For example, you want the parent to move to "To Do" to "In Progress" when all the sub-tasks move from "To Do" to "In Progress", then, you should:
{% set subtasks = parentIssue | subtasks %}
{% set trigger =
true
%}
{%
for
subtask in subtasks %}
{%
if
subtask.fields.status.name !=
"In Progress"
%}
{% set trigger =
false
%}
{% endif %}
{% endfor %}{{ trigger }}
Save the post-function, repeat the same for all the other transitions of the Sub-task workflow.
Regards,
Radhika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, thanks for the replay, but it does not seem to work. is it because the User story and the subtask have different workflows?
the Status and states are the same, it it just that the User story workflow have a trigger in the early state to fire a screen pop-up before moving from New to to do...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Having different workflows is not an issue. But having a screen might be. Does the screen have any mandatory fields to be filled during the transition Screen? If yes, then you should provide values to those fields in the post-function configuration under the "Transition screen" section.
Regards,
Radhika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am moving the sub-tasks from Review to Release using the button Reviewed.
Reviewed have id 21 and i am adding it in the top of the post function and at the button of the paste your script.
{% set subtasks = parentIssue | subtasks %}
{% set trigger = true %}
{% for subtask in subtasks %}
{% if subtask.fields.status.name != "RELEASE" %}
{% set trigger = false %}
{% endif %}
{% endfor %}
{{ trigger }}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Transition 21 will be triggered on the parent issue of the current issue (subtask).
Run as current user.
Run this post-function conditionally:
{% set subtasks = parentIssue | subtasks %}
{% set trigger = true %}
{% for subtask in subtasks %}
{% if subtask.fields.status.name != "RELEASE" %}
{% set trigger = false %}
{% endif %}
{% endfor %}
{{ trigger }}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
aslo, i moved this post function on the buttom of all the post functions.
Still not firing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Status names are usually not in all uppercase. They are displayed in uppercase on the issue view but if you look at the workflow editor or on the Statuses admin screen, you'll see the real transition name (which is case-sensitive)
So, in the script, replace "RELEASE" with "Release" or whatever the real status name is.
But as I said above, using a subtasks blocking condition is a better and easier solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.