Forums

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

Convert from string to number in Jira board custom Fields

gtez
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!
January 28, 2022

I am building a series of custom fields populated with three values each (e.g. 3-5-8) and a final "Result" field populated automatically with a formula taking the value from each of the previous field.

The Result field is built like this:

*Final Score:* {{#=}}
ROUND
(
(
{{issue.FPB - Business Value}} +
{{issue.FPB - Protect Value}} +
{{issue.FPB - Reduce Cost}} +
{{issue.FPB - Avoid Cost}}
)
* {{issue.FPB - Estimated Effort}}
, 0
)
{{/}}

My question is: Instead of showing the numerical value in the input fields, I would like to see something like Low/Medium/High.

The Final score formula should then associate to each response string a value number, e.g. Low=3, Medium=5, High=8 and compute the Result field.

Any idea how to do this?

1 answer

1 accepted

1 vote
Answer accepted
guismb January 28, 2022

Hey eZIO, I think there are more than one way you can accomplish this. You can have a multiple selection on the custom fields and then "translate" then into number when you'll get the result formula, something like (not sure if the syntax is correct, just the concept):

var x = 0;
if({{issue.FPB - Business Value}}==="Low"){
x = x+3
}

And then add the others conditions as well to have the medium and high plus the other fields.

Hope this helps.

gtez
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!
January 31, 2022

Thank you guismb. 

The logic works, however I am struggling with the syntax. I think my problem is with the definition of the variable, any idea how to make that work?

Suggest an answer

Log in or Sign up to answer