Smart Value Condtional Logic doesn't work on customfields - JIRA Server

Sidney Joshua Ambrose May 22, 2024

Currently working on an automation where I am trying to work with conditional logic on custom fields. The conditional logic works when ever I use system fields. 

For example - {{#=}} {{#issue.subtasks}} {{#if(equals(issuetype.name,"Approval"))}} {{fields.customfield_xxxxx}} + {{fields.customfield_xxxxx}} + {{/}} {{/}} 0 {{/}}

However, when I try to use the same logic on customfields, it doesn't work

Example - {{#issue.subtasks}} {{#if(equals(fields.customfield_xxxxx,"String"))}} {{fields.customfield_xxxxx}} {{/}} {{/}} 

Please do let me know your thoughts

1 answer

1 accepted

1 vote
Answer accepted
Kalyan Sattaluri
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.
May 22, 2024

Hello @Sidney Joshua Ambrose 

In this below syntax:

{{#issue.subtasks}} {{#if(equals(fields.customfield_xxxxx,"String"))}} {{fields.customfield_xxxxx}} {{/}} {{/}} 

What kind of field is this custom field?

Cause if its single select check box, drop down, you may have to use customfield_xxxxx.value..

If its multi select field field, then, even if you use customfield_xxxxx.value, it will provide a list and you cannot compare it to a value, you need to use "match" function instead..

So, need details on this field for us to tell if you can tweak your current syntax or you need a different way to do you check.

Thanks!

 

Sidney Joshua Ambrose May 22, 2024

Thank you so much for the help. It was a drop down and I used "customfield.value" and it worked.

Regards,
Sidney

Suggest an answer

Log in or Sign up to answer