Forums

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

Automation rule to multiply one custom field by story point field

Leena K May 15, 2024

Good day,

I have read most of the posts on how to create an automation rule to multiply story point field by another custom field(progress percentage), and store the result in a third custom field (completion)but nothing worked till now.

the objective is to multiply two fields and store the result in another custom field.

I’m using JIRA cloud version.

 

can somebody please provide a step by step instructions on how to achieve that?

 

 Thanks, 

 

4 answers

0 votes
Stevan Mandić
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 19, 2024

@Leena K In the previous comment I have explained you how to multiply two number fields

But....

What is the purpose of those calculation?

1) why do you multiply Progress Percentage by Story Points (how do you get Progress Percentage value? What does that value mean? Also, you should not multiply story points with any field since story points are relative estimations.

2) on what level do you need a Sum of all issues (calculation fields)? Project level?

What will that sum value tell you exactly?

Leena K May 19, 2024

my answer to point number 1 is that we are experimenting with this, if it works, we will think more about the math.

 

the answer to point two is yes on a project level.

Stevan Mandić
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 19, 2024

1) I strongly suggest you not to combine time/day(progress) estimations with story points (multiplication of those fields doesn't make sense)

2) you cannot sum up all values on project level. 

But:

What you can do is to sum up all calculation field values on Epic level.

Screenshot 2024-05-19 at 13.02.06.png

(Just replace customfield_id with your Calculation field Id, and also: put JQL condition "type!=epic" after trigger).

This rule says: when the value of calculation field changes for any issue, for parent Epic calculate the sum of all child Calculation fields and update Calculation field of the Epic.

 

If you are using Jira Premium and you have hierarchy level above the Epic, for instance: "Initiative", you could then create another rule which will update Initiative Calculation field when epic calculation field is changed (instead of "epicLink""and "Epic Parent" you will use Parent - both in branching and JQL). Also, put JqL condition "Type=epic" after the trigger.

important:  for both these rules you should mark the checkbox: Allow rule trigger- Check to allow other rule actions to trigger this rule since these rules depend on the automation rule that updates Calculation field on single issue.

Leena K May 19, 2024

I followed the steps you mentioned above and stayed away from story points (it make sense).

But the automation didn't work, and I'm not getting any error in the audit log, so can't identify why it's not working.

 

EpicAutomation.png

Leena K May 20, 2024

Its working now, the trigger can't be a calculated field that is changed by Automation.

so when i changed the trigger to fields that I change and are not automated by another rule this worked.

 

Thanks Stevan.

 

@Stevan Mandić 

Now do you know if there is a way to sum up the completion for all EPICS, this would give me a number of the project progress.

Stevan Mandić
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 20, 2024

@Leena K 

the trigger CAN be a calculated field (calculated by previous automation)

You example is correct, but you obviously missed the line from the previous comment.

If the trigger is the field value changed by some other automation rule, in your new rule details you just need to mark the checkbox: check to allow other rule action to trigger this rule.... 

(and your rule will work). 

____________

You have one typo: for {{lookupIssues... Issues have capital I...

Also as I mentioned before, you can use "Parent" both in Branching and JQL since "epic link" wili be replaced by "Parent" soon.

______

Regarding your question to sum up the completion of all  epics, you need a hierarchy level (issue type) above epic (e.g. Initiative)

So if all your project epics have the same parent (e.g. Initiative) you can use similar rule to update Calculation field on Initiative jira issue.*

*Hierarchy level above Epic is available if you are at least on Jira Premium subscription

if you are using Jira Standard, this can be solved by linking all epics to one Jira issue and creating automation rule to look up for all linked issues...

 


In case you need to use average instead of sum, you can replace sum with average in your expression

0 votes
Leena K May 19, 2024

@Stevan Mandić  do you know how can I create a field to sum the values of (Completion) field that was calculated in the previous step.

Sum = total (Completion) --> for every single (Issue, Task ...) in the project.

 

 

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.
May 15, 2024

Hi @Leena K -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

If you have not started a rule yet, I recommend trying to do so.  Successfully using automation rules requires learning and experimentation.  When one uses rules provided by others without understanding them, it is unlikely they will be able to maintain or improve them.

To get you started on creating your rule, please refer to these documentation and example sources:

Kind regards,
Bill

0 votes
Stevan Mandić
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 15, 2024

Automation:

1. Trigger: choose your trigger

2.action: Edit issue:

Edit field: Completion

Value: {{#=}}{{issue.customfield_XXXXX}} * {{issue.Story Points}} {{/}}

 

Replace XXXXX with your Progress Percentage custom field ID.

You can find custom field IDs if you type in your browser:

YourJiraInstance.atlassian.net/rest/api/latest/field

 

Both fields that are being multiplied have to be NUMBER fields.

Leena K May 19, 2024

Thanks Stevan ..., this worked.

Leena K May 19, 2024

@Stevan Mandić  do you know how can I calculate the Sum of (Calculation) field that was calculated in the previous step.

 

Sum = total (Calculation) --> (for every single issue, task, ... etc) in the project.


Leena K May 19, 2024

This is what I have done, but this is scheduled every 6 min, I couldn't test it yet, I need to wait 6 minutes, do you know how can I make it run every 1 min? maybe i need to work on the JQL query, but i dont know how to do that

Screenshot 2024-05-19 122041.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events