JIRA Automation Scoring an Issue based on the values of fields

Lindsey Dobson
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!
November 27, 2024

I am hoping someone can shed some light on the apparent syntax error I am getting for the below smart value formula I am using.

The purpose is to assign the issue a priority rank score based on the options filled out when the form is submitted and then subsequently updated.

All the field names are correct, with Story Points being the only built in field referenced.

Any help would be greatly appreciated!!

I get this error in the audit log:

  • Error rendering smart-values when executing this rule: Missing parameter(s) for operator +u: ( + + + + + + ) + ( + + + ) + ( + + ) + ( + + )

 

Code:

 

 

 

{{#=}}
(
  {{#if(issue.customfield_31600.contains("Will this feed a MIpack?"))}}7{{/}}
  + {{#if(issue.customfield_31600.contains("Going to the Global Teams?"))}}8{{/}}
  + {{#if(issue.customfield_31600.contains("Directly impacts customers?"))}}10{{/}}
  + {{#if(issue.customfield_31600.contains("Result in a cost FTE save?"))}}6{{/}}
  + {{#if(issue.customfield_31600.contains("Part of controls?"))}}8{{/}}
  + {{#if(issue.customfield_31600.contains("Forms part of reporting?"))}}10{{/}}
  + {{#if(issue.customfield_31600.contains("Related to CRM?"))}}5{{/}}
)
+
(
  {{#if(issue.storyPoints <= 0.25)}}9{{/}}
  + {{#if(issue.storyPoints > 0.25 and issue.StoryPoints <= 1.25)}}6{{/}}
  + {{#if(issue.storyPoints > 1.25 and issue.storyPoints <= 2.25)}}3{{/}}
  + {{#if(issue.storyPoints > 2.25)}}1{{/}}
)
+
(
  {{#if(now.diff(issue.created).days < 15)}}1{{/}}
  + {{#if(now.diff(issue.created).days >= 15 and now.diff(issue.created).days <= 45)}}3{{/}}
  + {{#if(now.diff(issue.created).days >= 45 and now.diff(issue.created).days <= 90)}}6{{/}}
  + {{#if(now.diff(issue.created).days > 90)}}5{{/}}
)
+
(
  {{#if(issue.customfield_24404== "High")}}8{{/}}
  + {{#if(issue.customfield_24404== "Medium")}}5{{/}}
  + {{#if(issue.customfield_24404== "Low")}}2{{/}}
)
+
(
  {{#if(issue.customfield_15814== "High")}}8{{/}}
  + {{#if(issue.customfield_15814== "Medium")}}5{{/}}
  + {{#if(issue.customfield_15814== "Low")}}2{{/}}
)
{{/}}

1 answer

0 votes
Dick
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.
November 28, 2024

Hi @Lindsey Dobson , Welcome to the Atlassian Community

It seems you're using expressions that do not exist in the Atlassian documentation on smart values: smart-values-text-fields  and smart-values-math-expressions/ 

  • Text comparisons are made using match instead of contains
    {{issue.summary.match(".*(lo).*")}} -> lo {{issue.summary.match(".*(o).*")}} -> [o, o]
  • Numerical comparisons are made using .gt and .gte instead of > and >=
    {{#if(issue.Votes.gte(100))}} Popular issue {{/}}

 

Hope this helps

Dick

Suggest an answer

Log in or Sign up to answer