Automation - Send out scheduled E-Mail when tickets in status "open" and sprint end date <3d

Konstantin Siegert December 9, 2024

Hello everyone,

I have a new topic I am working on and I would need some assistance on one question, as my current solution doesn't work as intended.

Use Case: I want to setup an automation which sends out an E-Mail to stakeholders, if there are tickets in stauts "open" in the currently running sprint and the sprint only has 3 days left, to inform them that these tickets may not be completed.

Current solution:

PS: The 5 minutes is just for testing!
image.pngimage.pngimage.pngimage.png

 

Problem: My issue is, that the E-Mail is sent out even if the sprint end date is not close to remaining 3 days.

I think the issue is, that the smart value for {{sprint.endDate}} isn't usable if I don't use "Sprint" as a trigger? Is this so?

Does anyone have an idea how to slove my Use-Case? :)

Thanks in advance!

Konstantin

3 answers

1 accepted

0 votes
Answer accepted
Konstantin Siegert December 9, 2024

Hey everyone,

@Bill Sheboy
@Marc - Devoteam 

I managed to solve it myself after a few hours :) Thanks for your hints, they helped me!

My solution was to create a variable with the lookup on the sprint End Date of the first issue. I then needed to format the variable with a ".toDate" and could then use the compare action:
image.png

Thanks a lot for your help!

BR

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.
December 9, 2024

The created variable you show will contain a list of values if the first issue from the lookup results has ever been in multiple sprints.  This will certainly make the condition work in unexpected ways.

 

This is why I suggested the method using smart value, list filtering to get the active sprint's end date:

https://community.atlassian.com/t5/Jira-questions/Re-Automation-Send-out-scheduled-E-Mail-when-tickets-i/qaq-p/2890489/comment-id/1073562#M1073562

Konstantin Siegert December 10, 2024

Hi @Bill Sheboy

one question here. I am performing the lookup on "openSprints()" with is defined as "Search for issues that are assigned to a sprint that was started, but has not yet been completed." (https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#openSprints--

My project always only has one active sprint and previous sprints are always completed. So in this scenario the check on "openSprints()" should be enough or am I misunderstanding something?

Thanks!

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.
December 10, 2024

If there are never any remaining incomplete issues in a sprint when the sprint completes, there will be no problem.  But if there are incomplete issues...

 

Here is the scenario I am describing...

  • Sprint 1 contains stories ABC-1, ABC-2, and ABC-3
    • Sprint 1 starts, and JQL checking sprint IN openSprints() will return all of them
    • ABC-1 and ABC-2 complete during the sprint
    • Sprint 1 completes, and ABC-3 carries over to the next sprint
  • Sprint 2 is planned, with stories ABC-3, ABC-4, ABC-5...
    • Sprint 2 starts, and JQL checking sprint IN openSprints() will return all of them
  • your rule runs, and in the lookup results
    • story ABC-3's sprint field contains Sprint 1, Sprint 2
    • story ABC-4's sprint field contains Sprint 2
    • story ABC-5's sprint field contains Sprint 2

 

And so this smart value expression:

{{lookupIssues.first.sprint.endDate.jiraDateTime}}

Will contain both Sprint 1 and Sprint 2's endDate values, separated by a comma...for example:

2024-12-09T09:23:12.0-0500, 2024-12-23T08:23:10.0-0500

 

1 vote
Marc - Devoteam
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.
December 9, 2024

Hi @Konstantin Siegert 

This will be feasible using a date difference smart value option.

{{now.diff(spint.endDate).days}} less then 3, you don't specify days in the second value just a number.

Or use {{now.diff(spint.endDate).days.abs}}

This is depending the positive or negative output of the smart clause.

add a log action in your automation to check the output.

Konstantin Siegert December 9, 2024

Hey @Marc - Devoteam

thanks for your quick answer :)

I tried your comment, but I'm not sure if I configured everything correct?

I tried to find out how to configure the Log Action, but the output is empty for both values?

image.pngimage.pngimage.png

Marc - Devoteam
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.
December 9, 2024

Hi @Konstantin Siegert 

After the lookup.

Branch your rule, using an advanced branch. the brach should be on {{lookupIssues}}

Then the in the branch place the compare and email action.

Currently the issues found in the lookup are not compared as you need to specify this by using the smart value {{lookupIssues}}.

This is also mentioned in the rule lookup issues action.

Konstantin Siegert December 9, 2024

Now I'm lost?

I didn't have any issues with the lookup without the advanced branch. All tickets have been correctly grouped in the e-mail sent.

What exactly should I do? Sorry, didn't quite understand your last comment.

Thanks in advance!

Marc - Devoteam
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.
December 10, 2024

Hi @Konstantin Siegert 

The lookup finds issues, but to iterate over the found issues.

Branch your rule, use an advanced branch with the values {{lookupIssues}}

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.
December 9, 2024

Hi @Konstantin Siegert 

If your sprints have a repeated and consist schedule, the simplest way to do this is to just set the Scheduled Trigger to only run on that specific day.

 

If your sprints vary, you could update your rule to check one issue in the sprint, extracting the end date for comparison.

Looking at the rule you show, there appears to be a typo in the JQL.  Please check that JQL outside the rule to confirm it works.

 

Back to your rule, the sprint field is a list of values, and so one value for the active sprint must be extracted to perform the comparison.  You could get the sprint end date from one of the issues in the lookup like this:

{{#lookupIssues.first.sprint}}{{#if(equals(state,"active"))}}{{endDate.jiraDate}}{{/}}{{/}}

This works by getting the first issue from the lookup results, iterating over the sprint field, and then filtering to get just the active one.  This handles the situation where an issue has been in multiple sprints.

Then store that with Create Variable to perform the comparison later.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events