Unable to run automation on custom field and smart values using LookupIssues

tasha tokunova March 17, 2022

I need a rule that will run on schedule, check JQL and send a list of tickets to a user.

I have issues with smart values when "send email"

Here's the email content:

{{#lookupIssues}}
<li>{{issuetype.name}}
Key+Summary: <a href="{{url}}">{{Key}} - {{summary}}</a>
All comments: {{comment}}
Returns last comment: {{issue.comments.last.body}}
Custom field value: {{issue.10033}}
</li>
{{/}}

 

When an email gets triggered I get blank values I miss {{issue.comments.last.body}} and {{issue.10033}}

2 answers

1 accepted

2 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.
March 18, 2022

Hi @tasha tokunova 

When your rule is inside of the {{lookupIssues}} you no longer use the {{issues...}} prefix to the smart values.  Their context is the lookup, and {{issues...}} refers to other contexts, such as either the trigger issue or issues within a branch.

Please try this: inside of the lookup iterator  {{comments.last.body}}

Kind regards,
Bill

tasha tokunova March 18, 2022

Oh wow! Thanks, Bill, it works! 

{{comments.last.body}} fixed

 

Do you know how to fix smart value to return custom filed body?

Custom field value: {{10033}}

This doesn't return the value ^

tasha tokunova March 18, 2022

I think I was able to find the answer, this is the way to go:

Custom field value {{fields.customfield_10033}}

Thanks @Bill Sheboy again! 

Like # people like this
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.
March 18, 2022

I am glad to learn that helped!

By the way, when you are trying to find the correct smart values to use for a field, this how-to article can help.  Basically you find an example issue and call the REST API from a browser tab to list all possible smart values.

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

Like tasha tokunova likes this
maurício heberle August 31, 2022

@tasha tokunova thank you for the custom field syntax. It wasnt described anywhere

Marc Isikoff
Contributor
November 6, 2023

If we are branching on the current issue that tripped the automation, we have a context of 1 (presumably), so the issue is known.

I'm looking for the right way to compare a custom field value within the branch because if you employ an "Issue matched JQL" it will auto add your branching issue as Key = issue# AND your JQL but my JQL gets squashed down to "is EMPTY" and fails.

The compare I am doing in JQL is: "{{issue.customfield_36800}} is EMPTY" (no double quotes in the actual JQL.)

The error shows: ""(key IN (PROJECT-###) AND (is EMPTY))"

Update: changed {{issue.customfield_36800}} to {{issue.fields.customfield_36800}} and met with a different error as it put in a date + time into the JQL complaining + is a reserved word and needs quotes.

So now it's vetting the value of the field and that errors; going to try {{issue.fields.custom_field_36800.value}} and see if that flies. ==> This reverted the error to "(key IN (PROJECT-###) AND (is EMPTY))"

This is a custom data/time field and we just want to update it if it does not hold a value already. This is for an SLA that was just met (time to first response) and we want to capture the date/time as Jira does not provide this in any reportable field.

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.
November 6, 2023

Hi @Marc Isikoff 

Did you post your reply in the wrong thread?  What you described seems unrelated to the question that was asked quite a while ago.

Kind regards,
Bill

Marc Isikoff
Contributor
November 6, 2023

@Bill Sheboy 

 

Edited the issue and it is above - need help

Like Bill Sheboy likes this
0 votes
tasha tokunova March 17, 2022

Screen Shot 2022-03-17 at 11.10.25 PM.pngScreen Shot 2022-03-17 at 11.09.45 PM.png

Suggest an answer

Log in or Sign up to answer