Hello there,
I am trying to create a Jira automation that send a slack message that contains the sprint goals for two teams.
Initially i had this structure:
When
Slack message
However, I noticed that it would send 20 + message for each issue that matches that JQL. I then tried to set an if statement checking a smart value "done" has a value, but it still sends the message 20 times.
Do you have an idea to pull the Sprint goal for only the first issue in the JQL list?
thanks !
OK @Salim Bouassida @Bill Sheboy
I have it working...at least to email, but theory is the same for Slack.
Schedule trigger (no JQL)
Lookup issues action with
sprint in openSprints()
as the JQL.
Send email/Slack action with:
{{lookupIssues.first.sprint.distinct.goal}}
Hello @Curt Holley ,
This worked perfectly !
I didn't need to create the variable, and used the reference in the slack message only.
Thanks for your help !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can someone please send exactly what this looks like? Or exactly where you are doing the lookup?
This is not working for me:
I have added in the scheduled JQL
sprint in openSprints()
and done an "Then" for sending the slack with:
{{lookupIssues.first.sprint.distinct.goal}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sonora Braun -- Welcome to the Atlassian Community!
If you read the other answers in this thread, you will find the solution:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Curt noted, your rule has JQL in the scheduled trigger. And for Jira Cloud, this mean it will try to execute for each issue.
Two possible solutions are:
Solution 2 is brittle because you may have carried over work from prior sprints, and when you do the wrong goals could be listed.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Option one is the go for sure!!! A much better solution indeed @Bill Sheboy
⭐
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bill Sheboy @Curt Holley ,
Thank you for your insights, it does help a lot with the reflection.
The automated slack message is a reminder a few days before the sprint review, so the option 1 does not work in my situation 🙁
I could remove the lookup from the trigger and have a Lookup Issues action, but that still creates a message for each issue in search.
1- Variable
{{#issue.customfield_10015}} {{#if(equals (state, "active")) }} {{goal}} {{/}} {{/}}
Gives me the right sprint goal, but 20 + times
2- Variable
{{lookupIssues.sprint.distinct.goal}}
Gives me current and past sprint goals, but 20 + times
I wonder if I can change the variable (1) to only include the sprint goal once (not for each issue)?
I saw @Curt Holley recommendation to use a label on one ticket in the sprint, and use that as a lookup, but I want to make the automation so simple, that the team doesn't need to do anything if I'm not there (ideally)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For method 1, the work-around is to gather the goals (with repeats) using a delimiter, and then split them again to grab just the first one.
For method 2, if you believe the lookup will contain just the issues you want, you can grab just one issue using first (or last), and then access the field:
{{lookupIssues.first}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Salim Bouassida
It is going to be to do with the fact that you have the JQL in the Scheduled trigger.
As that means the rule will action for every issue returned from that trigger.
So, at a high level, you need to have a JQL that will only find one issue.
Best idea I can think of (off the top of my head) is add a label to an issue in the sprint and add that into the JQL so it only finds that one issue....not ideal, but....food for thought perhaps?
Good luck!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.