updating Start and End date fields when issue moved from current sprint to backlog
Asked by Iana:

I have the custom fields Start Date and End Date that I use to get a better idea of my teams workload in the upcoming weeks. I've set in place an automation rule that automatically updates the Start and End date fields of each ticket in the sprint to the Start and End date of the current sprint. Here's a screeshot of how the rule is currently set up. ![Auto.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/143008i64D62ACA8F42D05E/image-size/large?v=v2&px=999 "Auto.PNG")

What it does :

When the value of the field Sprint changes

It updates Start and End date to 1 month from now

If the sprint field is not empty and the sprint is in current sprints or future sprints

then it updates again the start and end date to the start and end date of the sprint.

What I would like is to set u an automatic rule that takes into account the following case :

During my sprint planning, I included 15 ticket in my sprint backlog. At the end of the sprint, I realize there are a couple of tickets that I have to transfer back into the general backlog to be treated some time in the future.

The logic would be something like this :

For each ticket

If the current sprint is empty then

Start and end date = 1 month from now

else  
\<the rule screeshoted above\>

Any ideas on how I could do this?


Answers:
author: Fabian Lim
body: Hi Iana,

To trigger the rule for each ticket, you will have to use a scheduling trigger: (<https://support.atlassian.com/jira-software-cloud/docs/automation-triggers/>)

Recommendations:

- Create a schedule rule to run it every 2 weeks on the day of when the sprint ends. (e.g. On Fridays biweekly at the end of the day).

- In the JQL condition from the scheduler, ensure you pick up the right issue type or any other condition.

- Add the condition about the empty sprint value

- Add the 1 month from now changes to your dates

Keep the original rule separately since it will trigger when value changes and you need it.

I hope this helps.

comments: author: Iana
body: Hi Fabian,

Thanks for your suggestion. I used it as inspiration and created a set of 4 rules that should cover all of the possible scenarios:

1) Trigger : when the value of the field sprint changes : SD and ED (Start Date and End Date) take the values of last Sprints SD \& ED . =\> This rule doesnt do anything for issues that were transferred from a sprint to the backlog and issues where the sprint doesnt have any SD and ED)

2) Trigger : when a sprint is closed : tickets whose sprint value is not in open sprints or future sprints (i.e. transferred to the backlog) will take the value of 1 month from now

3) Trigger : when sprint is started : all the tickets take SD \& ED values from the sprint

4) Scheduled every 7 days : all tickets whose last sprint is not in open sprints or future sprints will take the value of one month from now

There is overlap between the rules but it's the way that I came up with to take into account all possible scenarios.

Thanks again for your help.


author: Bill Sheboy
body: Hi [@Iana](/t5/user/viewprofilepage/user-id/4087588)

I am confused by what you are asking and the logic you show at the end of your post. If there are tickets you are removing from the sprint and back to the backlog manually, why not use a manually triggered rule to update them as you need?

Best regards,

Bill

comments: author: Iana
body: Hi Bill, thanks for your suggestion. I was looking for a solution that would minimize manual actions to the most as I want to apply the rule across all teams and projets (including those on which I don't participate in the agile ceremonies).