Hello!
I'm using the automation functionality and I tried to use the "Create value" action to save a variable and compare it with a number but it does not work.
Here is the smart value in the variable TotalComplexity:
{{#=}} {{#if (issue.Deal type.isEmpty)}} 0 {{/}} {{#if(equals(issue.Deal type.value,"Private offering, budgettary RFI"))}} 1 {{/}} {{#if(equals(issue.Deal type.value,"RFP (private tender)"))}} 2 {{/}} + {{#if(equals(issue.RTI composition.value,"No RTI"))}} 1 {{/}} + 0 {{/}}
And here is the comparison code I've written:
{{#if ( {{TotalComplexity}} >= 1 )}} HIGH {{/}}
What am I doing wrong?
Thank you,
Martina
This is how I solved the problem:
{{#if ( TotalComplexity.asNumber.gte(30) )}} HIGH {{/}}
Hi @Martina Mulino and welcome to the community,
First of all, I would loose the spaces within the TotalComplexity variable and I don't understand why you start with a math ({{#=}}) smart value. And I don't know why there is a +0.
I would do it like this:
{{#if(issue.Deal type.isEmpty)}}0{{/}}{#if(equals(issue.Deal type.value,"Private offering, budgettary RFI"))}}1{{/}}{{#=}}{{#if(equals(issue.Deal type.value,"RFP (private tender)"))}}2{{/}}{{#if(equals(issue.RTI composition.value,"No RTI"))}}+1{{/}}{{/}}
this should result in a value 0,1,2 or 3. Check this by adding a audit log
Then for your comparison code use:
{{#if(TotalComplexity.AsNumber.gte(1))}}HIGH{{/}} ->(see math expressions)
Kind regards,
Rudy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.