Calculations in Jira
Asked by Robin Stemmers:

Hi All

I am a bit baffled about my calculation. Please help

I want to do a simple calculation

Input value x Rate = Cost

10 x 10 = 100

Input value 10

Calculation must do

Input value x Rate = Cost

My automation is set as follows:

On a numeric field "Cost"

{{#=}}{{isssue.customField_????}} \* 1.2{{/}}

Then I get this error  
*Error rendering smart-values when executing this rule:*  
*Unknown unary operator \* at character position 1: \* 1.2*  
What am I doing wrong?


Answers:
author: Kalyan Sattaluri
body: Hello [@Robin Stemmers](/t5/user/viewprofilepage/user-id/2666334)

Sorry but your post is not clear for us to help.

Assuming customField_12345 is your numeric "Cost" field, syntax is correct for below.

{{#=}}{{isssue.customField_12345}} \* 1.2{{/}}

But before you do calculation, can you post what {{issue.customField_12345}} holds from audit log?

Because what I gathered is, customField_12345 is your "Cost" field and earlier in your post, I see you talk about calculating cost from input value x rate. You are doing all that?

Please help us help you by sharing your rule and audit log..

comments: author: Robin Stemmers
body: Hi

You kinda got it, but let me break it down.

I have 3 numeric fields.

I want a user to input QTY ; the Rate is preset; Calculation must take place after saving.

EG: 10 x 2 = 20

Cost = Field "QTY" \* Field "Rate"

|-----------|------------|------------------|
| Qty Field | Rate Field | Cost Calculation |
| 10        | 2          | 20               |

Form View

![2024-03-28 06_12_22-Server Quotations - QA Media24 QA Service Desk - Jira Service Management.png](https://community.atlassian.com/t5/image/serverpage/image-id/315316i91A92C45AFE755C2/image-size/large?v=v2&px=999 "2024-03-28 06_12_22-Server Quotations - QA Media24 QA Service Desk - Jira Service Management.png")

My automation is triggered on Create

![2024-03-28 06_06_49-Audit log - Automation - QA_ M24 Service Desk - Jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/315317iC976A7FF80489639/image-size/large?v=v2&px=999 "2024-03-28 06_06_49-Audit log - Automation - QA_ M24 Service Desk - Jira.png")

Automation Error

![2024-03-28 06_13_22-Audit log - Automation - QA_ M24 Service Desk - Jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/315318i7C0996C00DC849AA/image-size/large?v=v2&px=999 "2024-03-28 06_13_22-Audit log - Automation - QA_ M24 Service Desk - Jira.png")

I hope that makes sense.


author: Kalyan Sattaluri
body: Hello [@Robin Stemmers](/t5/user/viewprofilepage/user-id/2666334)

There is a typo (extra s) in your formula. It should be issue, not isssue..

I copied your syntax and did not check either .. sorry. :p

Update to below:

{{#=}}{{issue.customField_11072}} \* 1.2{{/}}

BTW, I still havent figured out the requirement but please update and let us know if any further blockers.

Also, please do Action -\> Log to constantly log smart values so you are tracking progress and share screenshot of audit log showing that result for community to help quicker. Hope it helps! Thanks!


author: Robin Stemmers
body: [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306) Thank you so much.

That was a silly error :)

I tested this and it works perfectly.


Tags: cloud

jira-service-management

jira-service-management-cloud