Forums

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

How to read custom field value inside an automation?

Marcos Lopes March 26, 2023

Dear Support, 

I tried to read a custom field value on my Jira Service Management Project automation, but it didn't work. 

I tried many forms to read. For example: 
- I used this smart values formats: 
----------> {{issue.[name_of_custom_field]}} 
----------> {{issue.customfield_xxxxx}}
----------> {{issue.customfield_xxxxx.value}}

For debug, I created an advanced branching to copy this value to a variable. I called it "debug" and I created a comment inside a test issue. The result is: 
Debug is       -> the value didn't print in comment.

Please, I need some help here.

Best Regards, 
Marcos Lopes

CleanShot 2023-03-26 at 12.42.58@2x.pngCleanShot 2023-03-26 at 12.42.36@2x.png

2 answers

1 accepted

0 votes
Answer accepted
Joseph Chung Yin
Community Champion
March 26, 2023

@Marcos Lopes -

For Cascade Select List field usage, you will need to use the following smart value syntax -

{{issue.<your customfieldname>.value}} - To obtain the parent option value

{{issue.<your customfieldname>.child.value}} - To obtain the child option value

In my example see below -

My custom field is "Country-City"

2023-03-26_13-24-02.png

My automation rule (using log action action for debugging case on reading the field value) -

2023-03-26_13-27-12.png

As you can see if just using {{issue.Country-City}} smart value reference - I can see the return value is - 

My Cascade Field values are: {self=https://viasat.atlassian.net/rest/api/2/customFieldOption/10366, value=USA, id=10366, child={self=https://viasat.atlassian.net/rest/api/2/customFieldOption/10368, value=San Diego, id=10368}} 

However, if I want to access the actual parent and child option values, then I have to use 

{{issue.<your customfieldname>.value}} - To obtain the parent option value

{{issue.<your customfieldname>.child.value}} - To obtain the child option value

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

0 votes
John Funk
Community Champion
March 26, 2023

Hi Marcos,

What type of field is it? And how are you trying to use the field - in a email? In formula? Setting a value? 

Marcos Lopes March 26, 2023

I'm not trying used it on email. I created a automation to read this value and take a action on it. The type of custom field is Select List (cascading). This custom field concats the first and second choice in a string. 

Marcos Lopes March 26, 2023

I had set a configuration for this custom field:CleanShot 2023-03-26 at 12.51.59@2x.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events