Jira Automation: Error Rendering Smart Values for Story Points Calculation
Asked by Navi:

### Problem Statement: {#toc-hId--2146716199}

I am encountering an error while trying to automate the calculation of story points in Jira using smart values based on custom fields. The custom fields involved are "Complexity", "Effort Required", and "Skill Required", each with dropdown options (High, Medium, Low). The goal is to calculate the story points as an average of these values, assigning numerical values (High = 3, Medium = 2, Low = 1), and then rounding the result.

Error Message:

```
Error rendering smart-values when executing this rule: Failed to get value for ( (if(equals(issue.fields['Complexity'], 'High'), 3, if(equals(issue.fields['Complexity'], 'Medium'), 2, 1))) + (if(equals(issue.fields['Effort Required'], 'High'), 3, if(equals(issue.fields['Effort Required'], 'Medium'), 2, 1))) + (if(equals(issue.fields['Skill Required'], 'High'), 3, if(equals(issue.fields['Skill Required'], 'Medium'), 2, 1))) ) / 3.0 | round: {{ ( (if(equals(issue.fields['Complexity'], 'High'), 3, if(equals(issue.fields['Complexity'], 'Medium'), 2, 1))) + (if(equals(issue.fields['Effort Required'], 'High'), 3, if(equals(issue.fields['Effort Required'], 'Medium'), 2, 1))) + (if(equals(issue.fields['Skill Required'], 'High'), 3, if(equals(issue.fields['Skill Required'], 'Medium'), 2, 1))) ) / 3.0 | round }} } 
```

### Context: {#toc-hId-340796634}

I have set up the following custom fields:

1. **Complexity:** Dropdown with options (High, Medium, Low)
2. **Effort Required:** Dropdown with options (High, Medium, Low)
3. **Skill Required:** Dropdown with options (High, Medium, Low)

### Automation Rule Configuration: {#toc-hId--1466657829}

* **Trigger:** Field Value Changed for the custom fields (Complexity, Effort Required, Skill Required).
* **Action:** Edit Issue Fields to calculate and set the Story Points.

### Current Smart Value Expression: {#toc-hId-1020855004}

```
{ "fields": { "Story Points": {{ ( (if(equals(issue.fields['Complexity'], 'High'), 3, if(equals(issue.fields['Complexity'], 'Medium'), 2, 1))) + (if(equals(issue.fields['Effort Required'], 'High'), 3, if(equals(issue.fields['Effort Required'], 'Medium'), 2, 1))) + (if(equals(issue.fields['Skill Required'], 'High'), 3, if(equals(issue.fields['Skill Required'], 'Medium'), 2, 1))) ) / 3.0 | round }} } } 
```

### Issue: {#toc-hId--786599459}

The above expression fails to execute, returning an error about rendering smart values. The goal is to correctly evaluate the custom fields, convert their values to numbers, calculate the average, and round the result to set the Story Points.

### Request: {#toc-hId-1700913374}

Could the community provide guidance on the correct syntax or approach to resolve this error? Any insights into ensuring the smart values are correctly evaluated and the final result is computed accurately would be greatly appreciated.

### Additional Context: {#toc-hId--106541089}

* Jira Cloud environment
* Automation rule set up through Jira's built-in automation tools
* Custom fields are properly configured and visible on the appropriate screens

Thank you in advance for your assistance!


Answers:
author: Trudy Claspill
body: Hello [@Naveen](/t5/user/viewprofilepage/user-id/5565716)

Welcome to the Atlassian community.

I don't think that you are referencing the fields correctly.

To confirm that try using a Log action to print to the Audit Log the fields you are trying to reference exactly the way you reference them in the formula

<https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Log-action>

You are using

issue.fields\['Field name'}

I don't see "fields" as an attribute of the issue object in this documentation:

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/>

I believe you need to be using:

issue.Field Name


author: Bill Sheboy
body: Hi [@Naveen](/t5/user/viewprofilepage/user-id/5565716) -- Welcome to the Atlassian Community!

This seems to be a duplicate of your earlier question. Please close this one so the community can focus suggestions on the first one. Thanks!

<https://community.atlassian.com/t5/Advanced-planning-discussions/Jira-Automation-Error-Rendering-Smart-Values-for-Story-Points/td-p/2781565>

Kind regards,  
Bill


Tags: cloud

jira-cloud