Jira Custom Fields | Sum up of values

shravya sarabu April 24, 2020

Hi team,

 

1. Is there a way to sum up values of sub-tasks (for e.g., revenue)to add it to the task issue without using Script runner ?

2. Also is there a way to count the number of labels attached to an issue ?

 

Thanks in advance!

3 answers

1 accepted

2 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2020

Hi Shravya - Welcome to the Atlassian Community!

1. Yes, you can do that with the Automation For Jira tool built into Jira Cloud.

  1. Go to Project Settings > Project Automation (on left-hand menu)
  2. Press Create Rule in top-right corner
  3. Select the Trigger "Issue Created" and press Save
  4. Next Select to add an Action, and choose "Edit Issue"
  5. Select the field Label
  6. Select the options icon (3-dots) - and choose "Add/remove values"
  7. Enter the value you want as a default and press Save
  8. Name your Automation and turn it on

Now when each issue is created, it will add the desired default label as long as the issue is created in that project. You might need to refresh the page after each issue creation to see it.

You can do this via global rules to apply to all projects also. You'll need to be a Jira Admin/Site Admin, then instead of going to Project Settings, go to Jira Settings (cog icon on left-hand navigation bar) > System > Automation Rules (left-hand menu).

For more on using Automation For Jira see these help pages.

2. I am not aware of any way to count those. 

shravya sarabu April 26, 2020

Hi John,

I understand this solution you mentioned, but i was looking more like summing up the values of my Custom Field "Revenue". The context is something like , we have a task for the product team and multiple sales users would create sub tasks for each of their client requirements and the revenue for all the sub tasks can be added to the parent task automatically. Is that possible ?

For 2, my use case is to understand how many users are asking for a product feature and labels was one way i thought could help (multiple sales guys would be adding their customers who require that product feature and we thought addition of all labels of customers). Is there any other way I can use it ?

 

Kindly suggest.

Thanks in advance!

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2020

Yes, every time the value of one field is updated, you can add it to the value of another field. So if you have a total field that has a value of 10 and then you change the value of a different field from 0 to 5, you can have the total field up date to add the current value plus the new value of 5 to make it 15. 

shravya sarabu May 4, 2020

Got it, Thanks!

Irène May 5, 2020

Hi John, 

I have a similar task as Shravaya has in  #1: need to show the sum of  Earned field (which is a custom number field) in all tasks in the Epic. 

I still cannot get what exactly to write in the Set value on 'Edit issue' component. Could you please help?Image 2020-05-05 20-48-50.jpg

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 5, 2020

Hi @Irène  - You would use something like:

{{issue.customfield_16943}+{{issue.customfield_16719}}

But you would have to do that for one issue at a time. 

Irène May 5, 2020

Thanks, John for the great idea!  I used {{issue.Earned}}+{{triggerIssue.Earned}} and it works as I wanted. 

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 5, 2020

Perfect!!

Rachael Garbee August 20, 2020

 

I am trying to use the same type of calculation to sum numbers from a custom field called ROI. See screenshot. However when I use the Smart Value it isn't summing, I'm sure I'm missing something, it just keeps adding "+ number value" into the string in the parent. How could I make it so that when the child value is changed the parent value totals the new addition? Screen Shot 2020-08-20 at 7.28.33 AM.png

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 20, 2020

Hi Rachael - Is the ROI field a number type field?

Rachael Garbee August 20, 2020

Ah! Yes good catch ok that solves my addition problem. One follow up, hoping you may know? If I have $500 in a child and $400 in a child, they'll total into my parent as $900. However if I go back to one of the children and change the value it just adds again b/c I'm using an addition smart value. Is there a way for it to recalculate as well? Or would I need something else to do this?

 

Thank you SO much.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 20, 2020

Yeah, that makes it a little more complicated. In the past I have used a process where I create a new Custom Field that captures the difference between the current value and the new value. Then it is the custom field value that I use to do the + with. 

0 votes
Ha Tran May 25, 2022

I my case I only have SIL Engine (vendor cPrime) and I need to sum up numbers attachment files in sub-tasks and shows it on task. Any suggestions?

Thanks

Hannah

0 votes
TTK January 14, 2021

John, I am not seeing how this answer applies to my question.  I am trying to add 5 fields together in my ConfiForm, nothing to do with JIRA.  I tried formula ([entry.Amount1] + [entry.Amount2] + [entry.Amount3] + [entry.Amount4] + [entry.Amount5] ) but received error:

"Expression: [100+100+++] could not be calculated, Unknown operator '+++' at position 8"

Alex Medved _ConfiForms_
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.
January 14, 2021

You should really ask this as a new question, but what this means is you can "optional" fields and if you dont provide the values for all fields they stay empty and will fail.

What you shall be doing is to wrap these field values into ZEROIFEMPTY() function

(ZEROIFEMPTY("[entry.Amount1]") + ZEROIFEMPTY("[entry.Amount2]") + ZEROIFEMPTY("[entry.Amount3]") + ZEROIFEMPTY("[entry.Amount4]") + ZEROIFEMPTY("[entry.Amount5]"))

https://wiki.vertuna.com/display/CONFIFORMS/Supported+math+operators%2C+formulas+and+functions  

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 14, 2021

I am not familiar with CondiForm - sorry. 

TTK January 14, 2021

Thanks Alex I had that in my Rule but it was giving me the wrong answer, but if I enter in the Field formula its works.  It would be nice to know what the Rule gives me the wrong answer.  Because using the rule is nice to show the total right away to the user.

Thanks very much. 

Alex Medved _ConfiForms_
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.
January 14, 2021

It should work the same way in formula and in a rule (the rule should be "set expression")

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events