Hi JPD Community,
I’m working on a prioritization use case in Jira Product Discovery and have encountered some challenges with custom fields. Here's my scenario:
- I have a custom field called RICE, which contains a calculated RICE score.
- I also have a custom field called Weighted Score, which is another custom formula field.
- I want to calculate a new custom formula field called RICE x Weighted using the following logic:
- If Weighted Score is 0, the value of RICE x Weighted should be equal to the value of RICE.
- Otherwise, the value of RICE x Weighted should be RICE * Weighted Score.
Here’s what I’ve tried so far:
Custom Formula Field: I attempted to use the formula for the RICE x Weighted field:
<span>IF</span>(CAST({RICE} AS NUMBER) * <span>CAST</span>({Weighted Score} AS NUMBER) = <span>0</span>, {RICE}, {RICE} * {Weighted Score})
This resulted in an "Invalid expression" error. I suspect it might be due to {RICE} and {Weighted Score} being custom formula fields themselves.
- Automation with Edit Issue: For the automations, I created a new RICE x Weighted field that is a number field. I set up an automation rule with the trigger "When: Value changes for RICE or Weighted Score" and tried to use smart values in an Edit Issue action to calculate the value of the RICE x Weighted field. The format of the line I used was: {{#if(issue.fields["Weighted Score"] == 0)}} {{issue.fields.RICE}} {{else}} {{issue.fields.RICE}} * {{issue.fields["Weighted Score"]}} {{/}}. Instead of the names, I used the Smart Value of the custom field columns, so for Weighted - {{issue.fields.customfield_11111}} and for RICE - {{issue.fields.customfield_22222}} (I used these numbers in this question so that it is easier to follow).
- Automation with If then else:
- Trigger: when Issue is updated
- If: Used a {{smart values}} condition with {{issue.fields.customfield_11111}} equals 0.
- Edit issue: Selected RICE x Weighted and added {{issue.fields.customfield_22222}} in the input box (the value of RICE).
- Else
- Edit issue: Selected RICE x Weighted and added {{issue.fields.customfield_22222}}* {{issue.fields.customfield_11111}} in the input box (the value of RICE).
- For this automation, I get a success, yet I cannot see the value.
I also created a separate automation with a Log action with the Log message: "Weighted: {{issue.customfield_11111}}, RICE: {{issue.customfield_22222}} Weighted: {{issue.fields.customfield_11111}}, RICE: {{issue.fields.customfield_22222}}" and it did not display the values of the columns and I am now very confused.
I'm new to Jira Automations so there must be something I am missing, that's why I am looking forward to your help!