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

Lookup Issues Return Text String in Slack Message if Empty List

Brandon Moberg
Contributor
November 7, 2024

Hello!

I'm setting up a weekly bug alert summary for our scrum teams that surfaces bugs past due SLA. I am splitting the results by platform (mobile, server, web), so my approach is this:

  • Lookup Issues for the platform
project in ({{jiraProject}}) AND issuetype = bug AND priority in (critical, high) and component in (Android, iOS) and status not in ("Ready for Production",Done, "Won't Do", Deferred) and "Bug SLA Due Date[Time stamp]" < now() ORDER BY "Bug SLA Due Date[Time stamp]" ASC
  • Store that {{lookupIssues}} result in a lookup table

Screen Shot 2024-11-07 at 5.58.29 PM.png

  • Repeat for each platform
  • Then I send a slack message where I want to surface the issues from {{lookupIssues}} and if no issues, instead of surfacing a blank message, surfacing a specific text

Screen Shot 2024-11-07 at 5.59.54 PM.png

*Mobile*
{{#if(equals(mobileOutstandingBugs.size|0,0))}} No critical/high bugs currently exceeding SLA {{/}}
{{#if(mobileOutstandingBugs.size.gt(0))}}
{{#mobileOutstandingBugs.get("mobileOutstandingBugs")}}
• <{{url}}|{{key}}> || *{{priority.name}}* - {{customfield_10612.diff(now).days}} days past SLA - {{status.name}}
{{/}}
{{/}}

However this isn't working when {{lookupIssues}} is empty as it's not including the intended text. Any ideas on what I'm missing? TYIA!

Screen Shot 2024-11-07 at 6.02.34 PM.png

 

2 answers

1 accepted

0 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.
November 18, 2024

Hi @Brandon Moberg 

FYI, I recommend posting stuff like this as a question in the automation area.  It appears you have posted in the App Central area where vendors normally post marketing pitches for their apps ;^)

 

Back to your question...

You are storing the results of Lookup Issues actions in Created Tables, no doubt so you may have several of them to use in the message.  But you are not using get() or entries to iterate them as a list: https://community.atlassian.com/t5/Automation-articles/Update-Create-lookup-table-action-improvements/ba-p/2427798

The smart value expression {{mobileOutstandingBugs.size}} seems to be undefined,  and {{mobileOutstandingBugs.entries.size}} would be the number of rows in the table, and not the number of issues in the lookup.

Please try this for one of the number of issues in the lookup results:

{{mobileOutstandingBugs.get("mobileOutstandingBugs").size}}

 

Kind regards,
Bill

Brandon Moberg
Contributor
November 18, 2024

I was wondering why this didn't get any responses. I've asked a moderator to move this to the right spot. Thanks, @Bill Sheboy I'll give this a shot and report back!

Like Bill Sheboy likes this
Brandon Moberg
Contributor
November 18, 2024

That was the ticket, tested successfully with your updates. Thank you, Jira Master @Bill Sheboy !

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 18, 2024

Awesome; I am glad to learn that helped!

Like Brandon Moberg likes this
0 votes
Brandon Moberg
Contributor
November 18, 2024

Shot in the dark here, but @Bill Sheboy, have you dabbled in this before? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events