I would like to create a custom field of type “Formula” in a team-managed project. The formula is simple:
{issue.customfield_19054} * {issue.customfield_19055}
Both custom fields are of type “Number”. However, when I try to enter the formula, the fields are always highlighted in red and cannot be saved. I’ve tried various variants, including:
How do I reference custom fields correctly in a formula?
Hi @Moritz Lindenau
You need to create an automation rule to execute this calculation for you.
You also need a new field where the outcome of the calculation from the automation rule can be stored.
Jira automation math functions
Do you have an example for this automation at hand?
And why can't I use the new Formular custom field?
As @Marc -Devoteam- an automation will be needed to get to where you want to be
You will first need to create a new custom field for the calculation to be stored in
Then, create a new JIRA automation that will update the new custom field. When setting the content in that field, try the following formula
{{#=}}{issue.customfield_19054}}*{{issue.customfield_19055}}{{/}}
If this doesnt work, you can also try
{{#=}}{issue.customfield_19054|0}}*{{issue.customfield_19055|0}}{{/}}
I checked all instances I can use and the only custom formula field is only available in Jira Product discovery.
Based on this article, indeed formula fields should be coming to Jira, but based on the comments on the article it hasn't been rolled out.
https://community.atlassian.com/forums/Jira-articles/New-Feature-Formula-Custom-Fields-in-Jira-Cloud/ba-p/3163834
First of all, thank you for you hint to the automation. That is a valid workaround which works for me.
The formular field is already available in our space:
But when I try to use a custom number field for a calculation it does not work:
Thank you, that would work. But I would like to use the new custom formular field since this would be much faster implemented and more usable (field is already locked for instance).
Thank you. Instead of selecting a formula, can you try an automation rule where the THEN Edit Work Item
In choose field to set, find your new custom fieldIn the box that appears, paste the formulas I tried above
I believe what this does is input the value as if it were a formula but its not set as a formula field
Ive attached a screenshot of a similar automation I have built which may help
Hi @Moritz Lindenau I can see that you found a solution to your problem, but I'd still like to suggest another one in case at some point you find the native calculated/formula field type limiting or cumbersome to setup.
If you're open to a Marketplace app, Awesome Custom Fields has an Advanced Formula field type that's specifically designed for this kind of calculation. Full disclosure, I am affiliated with the team behind the app.
You can reference other custom fields in your formula and do math operations between them. It features auto-complete for simplicity, enhanced error hints for troubleshooting, and supports custom rendering.
To derive a numerical result from a formula, you can employ Jira Expressions for calculation.
It works on Jira Cloud, including team-managed projects.
Let me know if you have questions about how the formula field handles field references specifically.
It looks like you're new here. Sign in or register to get started.