Automation for Issues added in between sprints

Anand Vardhan August 20, 2019

Hi,

 

My team has a sprint for 2 weeks which always starts on 2nd Tuesday. Using automation I want to set a trigger where in once the sprint is started, any issue which added after two days of sprint start till the end of sprint, an email to be sent.

 

So far I'm thinking of using sprint start trigger and then adding JQL wherein it would simply contain created>startOfweek(+2d) and sprint in openSprint().

 

Any suggestion on how to go about it

3 answers

0 votes
Brock Jolet August 11, 2021

I do something similar except I simply check if the field value Sprint is empty.

I then update that value to the current open sprint.

 

So long as you never want to intentionally leave issues outside of any sprints, this should work.

0 votes
Nick Menere
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.
August 25, 2019

Hi Anand,

 

This is happening as the Sprint field has multiple values - one for each sprint it has been part of.

In order to do this correctly you will need to reference the first one,

{{#=}}{{issue.sprint.first.startDate.diff(now).abs.days}} > 2{{/}}

Hope that helps.

 

Cheers,

Nick

0 votes
John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 20, 2019

Hi Anand, 

this should be possible but it comes with the caveat that it might not work if the issue had previously been in another sprint. 

What you would need to do is: 

* Field Value Changed Trigger: for value 'Sprint'

* JQL condition: sprint in openSprint()

* Compare Condition: 

First value: {{#=}}{{issue.sprint.startDate.diff(now).abs.days}} > 2{{/}}
Condition: Equals
Second value: 1

* Action: send email 

 

Screenshot at Aug 21 11-30-23.pngThat should work for you but let me know if you have any issues!
Cheers,

John 

Automation for Jira 

Anand Vardhan August 20, 2019

Thanks for the response John!

Could you please elaborate on what "{{#=}}{{issue.sprint.startDate.diff(now).abs.days}} > 2{{/}}" this would do?

 

Also, as per my understanding, this would work every time someone edits the sprint value in an openSprint, right?

Anand Vardhan August 20, 2019

Screen Shot 2019-08-21 at 10.31.06 AM.png

This is what I set and I went ahead and created an issue but didn't get any email.

Anand Vardhan August 20, 2019

Screen Shot 2019-08-21 at 10.41.38 AM.png

This what shows in audit log

John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 21, 2019

Hey Anand,

so with that string, essentially what we are doing is combining the date and math functions to determine if the current date {now} is more than 2 days from the sprint date. It's a little complex but it should work. 

We will need to debug a little bit to find out what is going on. 

Could you add a log action after the first condition using that string? 

Also, could you add a debug into the compare condition? (this is just the info below)

{{#=}}{{#debug}}{{issue.sprint.startDate.diff(now).abs.days}} > 2{{/}}{{/}}

You can see more about the debugging here if you like. 

Should be able to get to the bottom of it soon.

Cheers,

John 

Anand Vardhan August 21, 2019

Hey John,

 

I've added both the log action and debug. Will send you screenshot if something is found.

 

Also, the sprint started on Tuesday (20th Aug) and today is Thursday (Indian Time). So I think our logic should work from Friday.

Anand Vardhan August 22, 2019

@John McKiernan1 

 

I'm getting the following error:

Screen Shot 2019-08-22 at 4.15.12 PM.png

Suggest an answer

Log in or Sign up to answer