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

Lookup issues looping Slack messages

Quinn Moffat June 2, 2022

Hello!

I've got an automation from Jira.

The intention is that every time a deployment happens, the list of issues from the deployment get put into a slack message, and then sent to a slack channel.

What is currently happening is: we get N messages, with N issues in each message. If we've released 10 items in the release, we get 10 messages with all 10 issues listed in each.

What am I missing?

Screen Shot 2022-06-03 at 4.14.39 PM.png

2 answers

1 vote
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 5, 2022

@Quinn Moffat

Apologies that you've run into this, we really need to rename these actions as it is a bit deceptive. They should be called issue deployed successfully. The trigger runs once for each issue in a deployment.

This is why you are seeing this behaviour.

Cheers,

Simeon.

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.
June 6, 2022

Hi @Simmo 

Thanks for the information!  From that trigger's smart values, it is possible to detect for which issue the rule is running?  https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/

If so, @Quinn Moffat could:

  • sort the JQL with ORDER BY Key ASC to feed to the Lookup Issues action, and...
  • add a condition to only proceed with sending the Slack message if the trigger issue is equal to the first one found in the lookup: {{lookupIssues.first.key}}

Kind regards,
Bill

Like Simmo likes this
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2022

Hey @Bill Sheboy,

I like it, thats some fancy thinking! I think so. {{issue}} should still work I believe so you can get the issue key that way! 

Like Bill Sheboy likes this
Quinn Moffat June 6, 2022

@Bill Sheboy I've given this a go:

I couldn't get the key within the conditional for whatever reason, so I've used the description field.

Screen Shot 2022-06-07 at 11.07.42 AM.png

Like Bill Sheboy likes 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.
June 7, 2022

Nice!  I am wondering why {{issue.key}} was not available for the comparison.

Got any ideas, @Simmo ?

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 7, 2022

@Bill Sheboy not in this case I'm afraid. It should be available or the rule would have errored. Would probably have to work backwards and start by adding a log component for {{issue}} and see what that gives, then go from there.

Like Bill Sheboy likes this
0 votes
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.
June 3, 2022

Hi @Quinn Moffat -- Welcome to the Atlassian Community!

Your rule seems to match the same use case shown here for this trigger: https://community.atlassian.com/t5/Automation-articles/New-Build-and-Deploy-triggers-for-Jira-automation/ba-p/1442789

When you look at the audit log, does it show the rule being triggered multiple times for the same deploy?

Kind regards,
Bill

Quinn Moffat June 6, 2022

Hey Bill! Correct. One deploy = N iterations,

 

where N is number of issues deployed

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events