Forums

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

Numerical Smart values from text string

Alexander.Neilson
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!
May 22, 2020

I am looking at effectively creating a matrix in the backend of jira. I am wanting to create a text string where the first character in the text string is an integer. Using smart values then taking the integer and combining it with another string of a similar nature to perform a numerical operation.

Below is a trivial example of what I am trying - 
Field 1 (Drop down called Field 1) Options -
1: small
2: medium
3: large

Field 2 (Drop down called Field 2) Options -
1: blue
2: green
3: red

Field 3 (numerical field called Field 3). Would it be possible in native automation to perform a calculation when field 1 is changed to adds 1st character of each text string together. 

Something similar to below which would take the options for arguments sake 1:small and 2:green to give a value of 3 (adding 1 and 2 together) 
{{#=}}{{issue.Field 1.charAt(1)}} + {{issue.Field 2.charAt(1)}}{{/}}

2 answers

1 accepted

4 votes
Answer accepted
Benoit
Contributor
June 16, 2020

{{#=}}IF({{issue.CustomFiledName.value.startsWith("3")}},3,IF({{issue.CustomFiledName.value.startsWith("2")}},2,IF({{issue.CustomFiledName.value.startsWith("1")}},1,0))){{/}}

 

Then add with the same pattern with the other field.

Stuart Nealis
Contributor
March 7, 2022

Benoit you are my hero, I came here with the exact idea as the OP and your solution got me through. Thank you!

Like Benoit likes this
0 votes
Benoit
Contributor
June 16, 2020

I am looking for a solution too. Did you found a way of doing that?

Thanks

Benoit
Contributor
June 16, 2020

{{issue.CustomFieldName.charAt(0).isNumeric}} is the closest I get. but still not there.

Suggest an answer

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

Atlassian Community Events