Forums

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

Issue with Jira Automation - Math Expressions Returning 0

Stephen Edvi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 5, 2024

I'm facing an issue with Jira automation rules where calculations involving custom numeric fields either return 0 or None, despite the fields being correctly populated with numbers. Here are the specifics:

  • Environment: Jira Cloud
  • Custom Fields: Reach, Impact, Confidence, Effort (all numeric fields)
  • Problem:
    • Simple math operations like {{#=}} 2 * 3 {{/}} work correctly and return 6.
    • When trying to use custom fields in the formula, the result is either 0 or None.
    • Example formula: {{#=}} {{issue.Reach | toNumber}} * {{issue.Impact | toNumber}} * {{issue.Confidence | toNumber}} / {{issue.Effort | toNumber}} {{/}}.
    • Fields are verified to be numeric and contain valid numbers (e.g., Reach = 3, Impact = 4, Confidence = 4, Effort = 2).
    • The automation logs show an error: "Could not convert the field value to a number."

Steps Taken:

  • Verified that all custom fields are set to numeric.
  • Confirmed that fields are populated and accessible within the issue.
  • Tested the formula with simpler arithmetic, which worked as expected.
  • Attempted using default() and toNumber() to handle empty or null values.

Request:

  • Looking for guidance on why Jira might be returning 0 or None when using custom fields in math expressions.
  • Has anyone else experienced this issue, or is there a known workaround or fix?

Appreciate any help or insights!

1 answer

1 accepted

2 votes
Answer accepted
Hana Kučerová
Community Champion
September 5, 2024

Hi @Stephen Edvi ,

welcome to the Atlassian Community!

Please see here, the sections about Multiply and Divide.

Also, toNumber should probably be replaced by asNumber (see here).

What I'm trying to say is that I believe syntax should be different with a usage of dots...

Hana Kučerová
Community Champion
September 5, 2024

Also, for debugging I strongly recommend you to use Log action, see here.

Suggest an answer

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

Atlassian Community Events