Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how to get the entire structure of smart values

Jonathan Gonzalez August 11, 2020

Hi team,

 

I would like to be able to see or generate an overview of the values for compare process like:

 

{{comment.Request participants.accountId}}

 

How can I know or find out the field and sub option inside each value for automations compare? For example, I need to know if one of the "Request participants" did enter a comment and then change status.

 

Regards,

Jonathan

1 answer

0 votes
Philipp Sendek
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.
August 11, 2020

Hi Jonathan,

the smart values are based on the information Jira exposes via REST.
So you should be able to see the structure of a smart value (or a customfield) using the corresponding REST endpoint.

Here's an official documentation on how to find the available options of a smart value/field:
https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

I hope that helps.

Regards,
Philipp

Jonathan Gonzalez August 13, 2020

This one is very interesting but I found out some custom values like this format

names.customfield_15501

Is it just the way it is? I mean, I can only use {{customfield_10034.value}} and not like {{customfield_10034.value.first}} or stuff like that?

And usually, if I see a field like "Request participants" I can just use it as I can see it?

 

Sorry If this like very beginners 

Philipp Sendek
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.
August 13, 2020

Hi Jonathan,

what I can generally always recommend (and do myself) is to add a "Log action" element into your automation.
This adds whatever value in the audit log entry of each run of your automation.

Within this element, you can try all the smart values you can think of or would like to use. Also, you can see what the value of a smart value is during runtime.
This is always the easiest way to figure out what works and what doesn't - already saved me a lot of hassle, especially with smart values containing email recipients who I don't want to spam with test mails. :-)

That being said: There are different ways you can refer to a customfield. Either of those should work:
{{issue.customfield_10034}}
{{issue.Name Of Customfield}} (yes, even with blanks between words) (That also answers your question regarding Request Participant with "yes". However, when referring to fields by name, you always need to make sure there is _always_ only one field with that name)

Whether {{customfield_10034.value.first}} works or not, depends on the type of customfield. If it's a list, I *think* it should work. But it's best to test it with the method above.

I know for instance, that the following works for user picker fields:
{{issue.Some User Picker.emailAddress}}
Which returns the email address of the user that is selected in the user picker.

So along with the infos you can pull from the REST endpoint mentioned in the docs above, you also have to somewhat guess what Java allows in terms of methods for each value.

I hope that helps you on your adventure trackling automations and smart values. :-)

Regards
Philipp

Suggest an answer

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

Atlassian Community Events