Forums

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

Automaton rule to update the 1st sub-task status upon Parent Status change

vincenzo.spatafora
Contributor
May 3, 2024

Dear ALL,

being trying to set a rule up such that when the status of a Parent changes for example to "In Progress", the associated first sub-task status is set also to "In Progress".

I know usually it's the way around but I need this case.

The sub-tasks are for example 3 but I need a rule to change the status only of first sub-task.

Is this feasible in Jira DC.

Attached what I've done so far but the rule changes the status of all the sub-tasks.

Thanks in advance.rule_for_sub-task_Status.PNG

2 answers

2 accepted

0 votes
Answer accepted
John Funk
Community Champion
May 3, 2024

Hi Vincenzo,

How are you identifying which subtask is the first one? Is there some value for that sub task that could be used in a condition?

vincenzo.spatafora
Contributor
May 6, 2024

Hi @John Funk,

thanks for your reply.

I understand the first sub-task should be identified by {{issue.subtasks.get(0).key}}.

Kind Regards, Vincenzo.

Like John Funk likes this
0 votes
Answer accepted
Bill Sheboy
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 3, 2024

Hi @vincenzo.spatafora 

For this scenario, you could branch on JQL to the specific issue, using the key, rather than branching on all of the subtasks.

Kind regards,
Bill

vincenzo.spatafora
Contributor
May 6, 2024

Hi @Bill Sheboy, happy to see you again.

Do you mean like the one I have attached.

If so, I get performance issues now as there are a lot of sub-tasks on my Jira Project and the limit has been execeeded.

Thanks in advance and have a nice week.

Kind Regards,

Vincenzo.rule_for_sub-task_Status.PNG

 

Bill Sheboy
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 6, 2024

I was suggesting to add to your branch JQL (or replace it with):

key = key of the desired subtask

That will ensure you only get the one you want.

vincenzo.spatafora
Contributor
May 6, 2024

Thanks @Bill Sheboy

Is it possible to make it more general?

I wouldn't know the key sub-task for the up-coming/next triggering issues which will be created.

Above, @John Funk was suggesting to place a condition. 

Kind Regards, Vincenzo.

Bill Sheboy
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 6, 2024

How do you know the "first subtask"?  Can it be identified by a field or sort order of fields?

In your response to John, you noted it was this one: {{issue.subtasks.get(0).key}}  If that is always the case, you could use this JQL:

key = {{issue.subtasks.get(0).key}}

However that may create problems if anyone re-orders the subtasks in the issue.

vincenzo.spatafora
Contributor
May 6, 2024

Thank You very much @Bill Sheboy.

I see now what you meant and it has worked, THANKS.

I get this error message (which I think it can be ignored (as it has worked)):

"Unknown fields set during transition. Field may not be on transition screen."

Would you know what I can do to avoid it.

Thanks a lot,

Vincenzo. 

vincenzo.spatafora
Contributor
May 6, 2024

and by the way @Bill Sheboy , after the JQL (used as Branch rule), how can I print in the log action the value of the key and its status? I have tried in different ways but I get alwasy an empty log. Is this maybe a known limitation?

Thanks, Vincenzo.

Bill Sheboy
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 6, 2024

Regarding that error, please check your workflow to see if a field is set by the transition.

Regarding logging the values, once inside of the branch, you may refer to it as {{issue}} in a Log action, such as with this:

Key: {{issue.key}} and Status: {{issue.status.name}}

 

vincenzo.spatafora
Contributor
May 7, 2024

Thank You @Bill Sheboy,

thanks to your help now it's fine.

You are above a Rising Star.

Kind Regards,

Vincenzo. 

Suggest an answer

Log in or Sign up to answer