Create variable with IF formula and smart values

Silas Campbell
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!
December 21, 2024

I'm trying to set up an automation rule in my Discovery project with a 'create variable' action using an IF formula.

This is what I entered, but I keep getting 'Parameter not closed' errors, but I don't know what I'm doing wrong!

{{#if({{issue.customfield_10105}}.lt(3),{{issue.customfield_10105}},{"0 - {{issue.customfield_10105}}*100")}}{{/}}

 

This is the IF formula i am trying to create:

  • logical test: 'Effort' score is less than 3
  • if true: 'Effort'
  • if false: 0 - 'Effort' * 100 (turns 'Effort' into a negative value and multiplies it by 100)

 

I'd be grateful if anyone can help me!

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 21, 2024

Hi @Silas Campbell -- Welcome to the Atlassian Community!

You appear to be trying the format of if() function which has true / false values: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#if

That format is this: {{if(smartValue, "value if true", "value if false")}}

Please note there is no pound sign # before the if() and once inside of the expression, no additional curly brackets are needed.  Also, you cannot use a literal value of 0 directly as the expression values are text and not within a math expression.

You seem to want to negate the field value and multiple by 100 for the "false" case, so perhaps try this instead:

{{if(issue.customfield_10105.lt(3), issue.customfield_10105, issue.customfield_10105.multiply(-100))}}

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events