Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Possible to do the Add/Subtract the number based upon on fields.

Santhosh Raj
Contributor
March 21, 2024

We have a project with some fields of adding and it needs to be updated to a specific field ?

For example:
Need to find the total spent Amount.

Now I have fields like.

  • Spent on Foods 
  • Spent on Goods & Services.
  • Spent on other Miscellaneous

I have these fields in Number field.
For now, I need to add all the spent above and make it as total spent and it needs to be updated in Total Spent field.

Also for Subtraction I need idea ?


Is there anything possible for achieving it ?

2 answers

1 vote
Kalyan Sattaluri
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.
March 21, 2024

Hello @Santhosh Raj 

Please take a look at below link, especially the first section about math expressions.

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

You can simply add/subtract like you would any expression.

{{#=}}{{issue.Spent on Foods}} + {{issue.Spent on Goods & Services}} - {{issue.Spent on other Miscellaneous}} * 5 {{/}}

Hope it helps.

 

 

Santhosh Raj
Contributor
March 21, 2024

Sorry. Since I haven't tried it.

May I know where to apply this .
If I'm using that, where to Update the formula 
{{#=}}{{issue.Spent on Foods}} + {{issue.Spent on Goods & Services}} - {{issue.Spent on other Miscellaneous}} * 5 {{/}}

Is it in the field or the context or let me know if you could help me please ?

Kalyan Sattaluri
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.
March 21, 2024

Hello @Santhosh Raj 

Apologies, I assumed too much.

Starting fresh, for a requirement like yours, (that is update a field based on something else), usual approach is to set up an automation rule.

This rule, depending on your requirement, can be set up to be run on a schedule (daily/weekly etc) or, listen to field changes such as if someone updated "Spent on Foods" fields, then the rule to run and udpate the total accordingly.

So with that as a background, if you are not familiar with Jira automation, I would suggest you spend some time looking into it and once familiar, we can then work to update your rule so it does what you want.

But because this requires Automation rule execution, I dont want to suggest you the rule unless you are clear on what it is and what to do.. because it costs money. So please review below link and let us know any questions.

 

https://www.atlassian.com/software/jira/guides/automation/overview#what-is-automation

So please review 

0 votes
Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2024

Hi @Santhosh Raj ,

You need to create Jira Automation.

When: Field change - add the 3 spend fields

Then: Edit field - select Total Spent field 

-Write the smartvalue below in the field.

{{#=}}{{issue.Spent on Foods}} + {{issue.Spent on Goods & Services}} + {{issue.Spent on other Miscellaneous}}{{/}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Service Management Events