Forums

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

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

1 accepted

0 votes
Answer accepted
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 edited

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
atlassian, aafp, jira migration, marketing collaboration, end siloed work, streamline workflows, kerrie gottschalk, jira cloud admins, unified marketing, process visibility, team efficiency, cross-team collaboration

How Kerrie Gottschalk unified AAFP’s marketing team with Jira

At the American Academy of Family Physicians, siloed marketing teams faced delays and duplicate work. Kerrie Gottschalk shook things up by moving the department to Jira, streamlining processes, boosting visibility, and sparking stronger collaboration.

Read the story
AUG Leaders

Atlassian Community Events