Automation to update custom label field based on two other custom label fields

Don Utley
Contributor
December 13, 2024

We've got a custom label field, "Fit /Gap Disposition", that is populated based off two other custom label fields, "Platform Fitness" & "Extensibility/Adaptability Fitness". The condition operator is "startsWith" because the values are like "5_90%_match" and "2_Customized to meet requirements"

  • IF "Platform Fitness" starts with 3, 4 or 5 AND "Extensibility...Fitness" starts with 3, 4 or 5 THEN "Fit/Gap Disposition" set to "Adopt"; 
  • IF "Platform Fitness" starts with 3, 4, or 5 AND "Extensibility...Fitness" starts with 1 or 2 THEN "Fit/Gap Disposition" set to "Argue"
  • IF "Platform Fitness" starts with 1 or 2 AND "Extensibility...Fitness" starts with 3, 4 or 5 THEN "Fit/Gap Disposition" set to "Adapt"
  • IF "Platform Fitness" starts with 1 or 2 AND "Extensibility...Fitness" starts with 1 or 2 THEN "Fit/Gap Disposition" set to "Avoid"

I'm trying to create an automation for whenever either two calculation fields are updated and both are populated, then run this calculation to set the Fit/Gap field. Below is screen shot and JSON for the rule as it currently is. I'm getting the error: 

 

 

No fields or field values to edit for issues (could be due to some field values not existing in a given project)

 

 

 

image.png

 

 

{ "conditions": { "and": [ 
{ "condition": { "field": "customfield_13900", "operator": "startsWith", "value": ["3", "4", "5"] } },
{ "condition": { "field": "customfield_13901", "operator": "startsWith", "value": ["3", "4", "5"] } } ] },
"actions": [ { "action": "set", "field": "customfield_13903", "value": "Adopt" } ] },

{ "conditions": { "and": [
{ "condition": { "field": "customfield_13900", "operator": "startsWith", "value": ["3", "4", "5"] } },
{ "condition": { "field": "customfield_13901", "operator": "startsWith", "value": ["1", "2"] } } ] },
"actions": [ { "action": "set", "field": "customfield_13903", "value": "Argue" } ] },

{ "conditions": { "and": [
{ "condition": { "field": "customfield_13900", "operator": "startsWith", "value": ["1", "2"] } },
{ "condition": { "field": "customfield_13901", "operator": "startsWith", "value": ["3", "4", "5"] } } ] },
"actions": [ { "action": "set", "field": "customfield_13903", "value": "Adapt" } ] },

{ "conditions": { "and": [
{ "condition": { "field": "customfield_13900", "operator": "startsWith", "value": ["1", "2"] } },
{ "condition": { "field": "customfield_13901", "operator": "startsWith", "value": ["1", "2"] } } ] },
"actions": [ { "action": "set", "field": "customfield_13903", "value": "Avoid" } ] }

 

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 13, 2024

Hi @Don Utley 

Would you please show an image of your rule's Edit Issue Fields action and of the audit log details showing the rule execution?

Until we see those...

I hypothesize you are trying to use that expression you show in the advanced edit with JSON, but it is neither valid JSON nor a valid conditional expression: https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html

Where did you find that syntax for performing a conditional check within JSON?

I recommend instead using the conditional logic and created variables to break this up into multiple parts, allowing easier rule maintenance and debugging using writes to the audit log.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer