Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,175
Community Members
 
Community Events
168
Community Groups

Automation: Lookup, Email, Smart Values

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

@Fred

Have you already tried:

{{customfield_13264.value}}

OR

{{issue.customfield_13264.value}}

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!

Perfect! I appreciate the help.

Like swilson likes this

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}}
{{/}}

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,008 views 18 31
Read article

Atlassian Community Events