Forums

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

Automation smart values - JIRA comment with a value of a custom field that has a space

Dd
Contributor
October 30, 2023

Hi,

I have a custom field Time Frame that has several values (Today, Tomorrow, Next Week).

I would like to add a JIRA comment when conditions are met where the Time Frame value is part of the comment.

How do I refer to it?

All my attempts failed.

Thanks 

1 answer

1 accepted

3 votes
Answer accepted
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.
October 30, 2023

Hi @Dd 

There are at least two ways to check the content of a field to perform the behavior you ask:

Use text and conditional functions to extract / test the value, and then add your field.  Please look here to learn about those: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/ and https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/

Use rule if / else conditions to check the value, with your two processing paths.  Please look here to learn about those: https://support.atlassian.com/cloud-automation/docs/jira-automation-conditions/

Kind regards,
Bill

Dd
Contributor
October 30, 2023

What I'm looking for is what to write when referring to a custom field with a space in the name, in my case 'Time Frame".

For example, if I want to print out the summary of a ticket I use: {{issue.fields.summary}}

What do I use for the filed Time Frame?

I tried both {{issue.fields."Time Frame"}}  and {{issue.fields.Time Frame}}

Neither worked

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.
October 30, 2023

Thanks for clarifying!

Smart values are name, spacing, and case-sensitive.  And, they often are not exactly the same as the displayed name on the page for the field.  When the incorrect smart value is used in a rule, if often fails with no error and instead just returns null.

To learn the correct smart value for a field, please use the how-to article linked below.  Essentially you identify an example issue with your field, call a REST API function with a browser tab, and search for your field on the page with Control-F.  This will also show the custom field id for it, as that works in some cases where the smart value, name does not.

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Dd
Contributor
October 30, 2023

Awesome!

Worked like charm (though for some reason I had to use version 3 and not version 2

Thanks

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events