Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom field not working in smart values in my case

Abhijeet Panganti September 27, 2024

 

 

I have a custom field 'Branch' on my Bug screen. I want to manually trigger an automation rule from a Bug item. The automation rule runs a JQL and finds all Bugs where the Branch field matches with the Branch field of the Bug item from where the automation was triggered.

I have tried the following options but nothing worked:

Branch = {{triggerIssue.Branch}}

Branch = {{triggerIssue.customfield_Branch}}

Branch = {{triggerIssue.customfield_Branch.value}}

 

Any help is appreciated. Thanks in advance.

3 answers

3 accepted

2 votes
Answer accepted
Sebastian Krzewiński
Community Champion
September 27, 2024

Hi @Abhijeet Panganti 

 

You need to use customfield id (customfield_<your_id>) or customfield name instead triggerIssue.customfield_Branch.value. It should be: triggerIssue.Branch.value or triggerIssue.customfield_<your_id>.value

Abhijeet Panganti September 27, 2024

 triggerIssue.Branch.value did not work.

Not sure how to get the id of the custom field in order to try  triggerIssue.customfield_<your_id>.value

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.
September 27, 2024

Hi @Abhijeet Panganti -- Welcome to the Atlassian Community!

Please use this how-to article to find the correct smart value (or custom field id) for a field: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Also note that smart values are name, spacing, and case-sensitive.  And so the exact one must be used or it will evaluate to null and not work as expected.

Kind regards,
Bill

Like # people like this
Abhijeet Panganti September 30, 2024

Thanks a lot, @Bill Sheboy 
The how-to article you shared really helped in getting good insights into the subject and led me to reach the solution. 
I had a few more custom fields on which I had to apply conditions and the structure of each varied. 

https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names

With the help of the above URL mentioned in the article, I could view the structure of each of the elements and accordingly used them in my JQL which finally worked to my requirement.

Like Bill Sheboy likes this
Brent Nye February 10, 2025

In Jira 9.12, triggerIssue.Branch.value does not work. However, triggerIssue.customfield_<your_id>.value does work.

0 votes
Answer accepted
gb sheet
Banned
September 30, 2024

To use the custom field in a JQL for an automation rule, try this format:

Branch = "{{triggerIssue.fields.customfield XXXXX}}"

Replace XXXXX with the actual custom field ID of the "Branch" field. You can find the custom field ID by navigating to Custom Fields in Jira and locating "Branch."

This should allow you to match the Branch menuland field of the trigger issue in the automation.



Abhijeet Panganti September 30, 2024

Thanks a lot @gb sheet. My issue has been resolved now.

0 votes
Answer accepted
Cristian0791
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.
September 28, 2024

Hi Abhijeet,

To find the Custom Field ID:

1.Go to Custom Fields

2.Select the desire field

3.Click Edit Details

 

Then you can find the field ID in the URL

Field ID.png

Abhijeet Panganti September 30, 2024

Thanks a lot, @Cristian0791 for sharing the way of identifying the custom field id. It helped me move forward in my requirement.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events