Forums

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

Auto set task field due changes on its subtasks

Oficina de Proyectos April 11, 2022

hello, we are trying to make a rule that is executed whenever there is a modification in a field of a subtask.
The rule consists of performing an operation on a smart field. In this case, the "progress percentage" field of a task must vary according to the value of the "progress percentage" of its subtasks.
In a scenario of a task with two associated subtasks, the operation should be:
(subtask 1 progress percentage*originalestimate subtask 1+subtask 2 progress percentage*originalestimate subtask 2)/(originalestimate subtask 1+originalestimate subtask 2).

We add a screenshot of the standard as it is, but we still need to complete the additional fields section:

image.png

1 answer

0 votes
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.
April 15, 2022

Hi @Oficina de Proyectos -- Welcome to the Atlassian Community!

To gather the information from your subtasks, please review the Lookup Issues action and List functions:

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/

Using JQL you may gather all of the subtasks with the same parent as your trigger issue into the {{lookupIssues}} smart value, and then you may use the list functions to perform the math operation you note.

If you need any temporary storage to compute the fields, please review the Create Variable action to store those:

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable

Kind regards,
Bill

Oficina de Proyectos April 19, 2022

Hi @Bill Sheboy, thanks for your help

We have tried to perform operations using lists, but the final result is not satisfactory.
First of all, we have created the variable "operation".

image.png

Then, the variable "sum".

image.png

Finally, the variable "FinalValue".

image.png


Then we call the result value and we get the following error

image.pngimage.png

Could you please help us solve this problem?

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.
April 19, 2022

There are two ways to perform most of the math operations with smart values:

Inline with dot-expressions:

{{issue.myFieldA.multiple(issue.myFieldB).divide(10)}}

With the {{#=}}...{{/}} syntax.  The equivalent of the above would be:

{{#=}} {{issue.myFieldA}} * {{issue.myFieldB}} / 10 {{/}}

 

Please look here for more details on these methods:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

 

Also please note: there is a typo in your FinalValue created value expression where "aggregate" is misspelled.

Suggest an answer

Log in or Sign up to answer