Due date of certain issue set to the due date of a certain sprint
Asked by BenWade:

Hi everyone,

There are old posts related to this topic, but they are unclear.

I have several projects in Jira Premium Cloud: Projects A, B, C, and D. Each project has its own sprint. I want subtasks, tasks, bugs, and stories to automatically take the due date of the sprint based on the 'Sprint' field. I want an automation rule to check the 'Sprint' field of these issue types. If it is not empty, the rule should then check the end date of the sprint and set that as the due date for the issue.

There is [an old post](https://community.atlassian.com/t5/Jira-questions/How-can-i-update-issue-due-date-to-sprint-end-date/qaq-p/997859) suggesting a method that only sets the due date if the sprint has already started, which is irrelevant to my needs. I need automation to set the due date even if the sprint has not started yet. I create sprints in advance, and my team works in 1-month sprints. For example, we currently have an active July sprint, and I am already assigning tickets to the upcoming August sprint. At the end of the month, I will close the July sprint, move open issues into the August sprint, and add extra issues from the backlog into the August sprint.

In summary, I want a flexible rule that sets the due date of issues based on the sprint indicated in the 'Sprint' field, regardless of whether the sprint has started or not.  

**#jirapremium**

**#jiracloud**

**#companymanaged**


Answers:
author: Jeroen Poismans
body: Hi!

I've got a rule that does just that. It triggers on the **Sprint** fieldchange:

![Screenshot 2024-07-10 at 10.21.47.png](https://community.atlassian.com/t5/image/serverpage/image-id/334532i9A4B1D6A9BB2B286/image-dimensions/442x125?v=v2 "Screenshot 2024-07-10 at 10.21.47.png")

As you can see I use a Smart Value sin the editing of the due date:

```
{{issue.Sprint.endDate.jiraDate}}
```

More info on Smart values can be found here:

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/>

Hope this helps!

comments: author: BenWade
body: Could you please tell mem which step and where to add so I can choose specific issue types. I want this to work only for bugs and tasks


author: Marc - Devoteam
body: Hi [@BenWade](/t5/user/viewprofilepage/user-id/5253602)

Use a condition before the edit action.

Condition:

![Screenshot 2024-07-10 at 12.58.54.png](https://community.atlassian.com/t5/image/serverpage/image-id/334589i850CC27008874E98/image-dimensions/403x260?v=v2 "Screenshot 2024-07-10 at 12.58.54.png")

comments: author: BenWade
body: Thank you [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) ??  
I hope it is ok if I accept [@Jeroen Poismans](/t5/user/viewprofilepage/user-id/1708479) response.  

Unfortunately, I cannot accept two answers.


author: BenWade
body: I am curious, I have end date 2nd of August  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/334593i5D0D4E288897BCA3/image-size/large?v=v2&px=999 "image.png")  
Why the automation sets the due date to 1st August

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/334594i87858A3AAB93008C/image-size/large?v=v2&px=999 "image.png")


author: Jeroen Poismans
body: Hi Ben,

Might have something to do with End date being at 12:00AM?


author: Marc - Devoteam
body: [@Jeroen Poismans](/t5/user/viewprofilepage/user-id/1708479)

Could well be as I remember. You would need to specify 23:59 PM.


Tags: cloud

jira-cloud