How to sum values calculated in 5 Custom Fields in another Custom Field
Asked by Bola Oye:

I have 5 Custom Fields and each Custom Field is being used to calculate the Monthly Payment. The default value is set at 0 for all the Custom Fields. When the Workflow transitions to Active the following values are correctly generated

e.g.

Monthly Payment A = 10

Monthly Payment B = 15.67

Monthly Payment C =12

Monthly Payment D = 15

Monthly Payment E = 20

I have created another Custom Field - **Monthly Total** which is to sum the 5 above.

**I am using the Automation Rule**

**When the Value changes for**

Monthly Payment A, Monthly Payment B, Monthly Payment C, Monthly Payment D

Monthly Payment E

**And: Edit issue fields**

**Monthly Total**

{{#=}}{{issue.Monthly A\|0}} + {{issue.Monthly B\|0}} + {{issue.Monthly C\|0}} + {{issue.Monthly D \|0}} + {{issue.Monthly E\|0}}{{/}}

I am not getting any result. What am I missing?


Answers:
author: John Funk
body: Hi Bola,

I am not see anything there that should give you a problem. Maybe start small by only summing up two fields and see what happens.

Also, you might try using the ID of the custom fields instead of the name to see if that helps. It would look like this:

{{#=}}{{issue.customfield_10091}}+{{issue.customfield_10089}}{{/}}

comments: author: Bola Oye
body: Hello John

Thank you for the response. I tried the two suggestions earlier on and was not getting any results.

1. i used one and later added two customs field

2. I used the ID of custom fields still no result.


author: John Funk
body: Try adding a log of each of the fields to see if they are returning any values. Also, can you share the rule and the audit log when you run it? I suspect the rule isn't even really running.


author: Bola Oye
body: ![Screenshot 3.png](https://community.atlassian.com/t5/image/serverpage/image-id/254538i4EE8CC550711DF78/image-size/large?v=v2&px=999 "Screenshot 3.png")![Screenshot1.png](https://community.atlassian.com/t5/image/serverpage/image-id/254540iD5B6E6026856E116/image-size/large?v=v2&px=999 "Screenshot1.png")![Screenshot2.png](https://community.atlassian.com/t5/image/serverpage/image-id/254539i1F951A4E0AD2C9CD/image-size/large?v=v2&px=999 "Screenshot2.png")


author: Bola Oye
body: I am not sure if I have the audit log at the right place. I still don't have an output even though the status output is success


author: John Funk
body: Sorry, I was looking more for the log of the fields that were changing, not the Description field. Make sure you use the Case exactly as the field name. Wanting to see what the values are in those fields.


author: Bola Oye
body: ![Screenshot 2023-05-01 151407.png](https://community.atlassian.com/t5/image/serverpage/image-id/254733i5AE8AA85B3CC4A28/image-size/large?v=v2&px=999 "Screenshot 2023-05-01 151407.png")

While I have 0.0 showing on the Log above, the correct values for Monthly A Monthly B Monthly C Monthly D Monthly E showed up on the form.


author: John Funk
body: That's definitely the problem then - automation is not properly pulling the values for those fields.

Are you logging the values of the those individual fields? Or the calculated ones?


author: Bola Oye
body: Is there a document that I can look at to resolve the issue? Any suggestions will be appreciated. thank you.


author: John Funk
body: There is not a document per se that shows how to resolve a particular issue. I would add logging for each of the custom fields so you can see what is in each field prior to the calculation.


author: Bola Oye
body: Do you have any suggestion


author: John Funk
body: Do what you have done above, but Log the Monthly A and Monthly B fields, etc.


author: Bola Oye
body: 1. I see the Monthly A value in the customized sub-task (I created a different screen) below = 22.5

2. the amount shows up

![Screenshot 2023-05-15 162546.png](https://community.atlassian.com/t5/image/serverpage/image-id/257386iE2214CF313610BB4/image-size/large?v=v2&px=999 "Screenshot 2023-05-15 162546.png")

2. the amount shows up on the form page of the screen

3. I have logged Monthly A, Monthly B still 0.0


author: John Funk
body: Can you share the screen print from the audit log like to did above for the Monthly A and Monthly B fields where you logged them?


author: Bola Oye
body: ![Screenshot 2023-05-16 111238.png](https://community.atlassian.com/t5/image/serverpage/image-id/257571i31F4878BE380DD16/image-size/large?v=v2&px=999 "Screenshot 2023-05-16 111238.png")

**The Monthly B is setup with default of 35**

![Screenshot 2023-05-16 111931.png](https://community.atlassian.com/t5/image/serverpage/image-id/257573i15DD76303A290222/image-size/large?v=v2&px=999 "Screenshot 2023-05-16 111931.png")

**The Monthly A is setup with {{#=}} {{issue.Analog Port Qty}} \* 7.5{{/}}**

![Screenshot 2023-05-16 111830.png](https://community.atlassian.com/t5/image/serverpage/image-id/257574i429C296E3863EE95/image-size/large?v=v2&px=999 "Screenshot 2023-05-16 111830.png")

**The Total is setup as:**

![Screenshot 2023-05-16 112020.png](https://community.atlassian.com/t5/image/serverpage/image-id/257576i988322AF5D8A9B65/image-size/large?v=v2&px=999 "Screenshot 2023-05-16 112020.png")


author: Bola Oye
body: Are there any other suggestions. We need to go live asap. thank you.


author: Bola Oye
body: Do I need to post my issue on another platform please? I need some help to resolve the issue. Thank you


author: John Funk
body: Sorry - you probably should open a support ticket with Atlassian as I am not able to see your data or delve further into it.


Tags: cloud

jira-work-management-cloud