Automation: Lookup, Email, Smart Values

Fred August 26, 2022

Good day!

I have an automation to run every month, that successfully looks up issues and emails them to me. The data I'm sending will eventually end up in a gsheet. I'm getting tripped up on the smartvalue syntax. 

{{#lookupIssues}}
{{key}}, {{issue.customfield_13264.description}}
{{^last}}
{{/}}
{{/}}

Key/comma/linebreak are perfect. How do I get custom field values? None of the permutations I've tried works.

Thanks for your wisdom!

3 answers

1 accepted

3 votes
Answer accepted
Sue Wilson August 26, 2022

@Fred

Have you already tried:

{{customfield_13264.value}}

OR

{{issue.customfield_13264.value}}
0 votes
Sue Wilson August 26, 2022

Glad it works!

You are looking up a list of issues.  The fields you want to display are the key and the customfield.  Since you already have an issue in context based on your query, you do not need to prefix the smartvalue with "issue.".  That is why you have {{key}} instead of {{issue.key}}. 

{{^last}}

{{/}} - effectively closes the lookup issue after all issues from the query have been identified.

Additionally, using ".value" instead of ".description" brings the custom field value into the results, as expected.  Description would bring back the description provided in the custom field's configuration, if any, which does not give you what you are looking for.  I hope this helps!

Fred August 26, 2022

Perfect! I appreciate the help.

Like Sue Wilson likes this
0 votes
Fred August 26, 2022

The first works! Is that the syntax for lookupIssues, leave off issue.? 

I understand that {{/}} closes the #lookupIssues. Can you explain what this is saying?

{{^last}}
{{/}}
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.
August 27, 2022

Hi @Fred 

The {{^last}}something{{/}} structure allows you to conditionally do things inside of the list iterator.  For example, 

{{#lookupIssues}}{{key}}{{^last}}, {{/}}{{/}}

Will add a comma after each key value except for the last one; that is what the ^ last represents: not last.

Please refer here for more information on other operators for list management: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#Combined-function-examples

Kind regards,
Bill

Like Dave Furlani likes this

Suggest an answer

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

Atlassian Community Events