Forums

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

Using conditional loop in calculated field JWT

simarpreet singh
Contributor
June 5, 2020

Hi team,

I have created a number calculated field by JWT. Under math expression, I want to add a condition that when the option is yes for field A, this calculated field is set to 1, if the option is No, then this is set to 0. Else, nothing should happen.

I'm able to do this for yes and No. But not able to restrict it for other dropdown option which is None. I know I can remove None by making field A as mandatory and setting a default option, but I don't want to make that change.

Is there anyway to achieve this.

Thanks,

Simar

 

1 answer

1 accepted

0 votes
Answer accepted
Thorsten Letschert _Decadis AG_
Atlassian Partner
June 5, 2020

Hi @simarpreet singh ,

given your field A with the field code 12345, your expression could look like this:

%{12345} = "yes" ? 1 : (%{12345} = "no" ? 0 : null)

Please let me know if that solves your requirement.

Cheers
Thorsten 

simarpreet singh
Contributor
June 5, 2020

Hi @Thorsten Letschert _Decadis AG_ -

Unfortunately, this doesn't worked. It only works as

%{12345} = "yes" ? 1 : 0

 I cannot proceed further after 0 as the syntax doesn't permits. Indirectly, I can use if else but can't use if, else if, else... which you provided your solution on.

Thorsten Letschert _Decadis AG_
Atlassian Partner
June 5, 2020

Hi @simarpreet singh ,

please specify 'I cannot proceed further' since everything is working as expected on my instance given the expression above, e.g.

jwt_conditional-calculation.gif

simarpreet singh
Contributor
June 5, 2020

Hey @Thorsten Letschert _Decadis AG_ -

It's working perpectly. Sorry I missed a bracket so was getting syntax error.

Thanks a to man... cheers

simarpreet singh
Contributor
June 5, 2020

@Thorsten Letschert _Decadis AG_ - Can you also let me know which scripting language is this?

Suggest an answer

Log in or Sign up to answer