Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Notifications for due date account for weekend

Sorren Day September 1, 2023

Hi there,

I have a couple of simple automations setup to send an email notification if a task/issue's due date is today or 1 week away.

I would like to set another up for if the due date is 3 days away. However, for both the 3 day and 1 week ones I would like it to take into account business days only.

 

My current automations are using a very simple code that does the job, which is:

Today notification: due <= 1d

1 Week notification: due <= 1w

 

Any help would be much appreciated.

2 answers

0 votes
Phill Fox
Community Champion
September 13, 2023

Hi @Sorren Day 

Would you like to try this JQL and see if this works for you? 

 

project in (<projectlist>) and ((duedate <3d and duedate <endOfWeek(-2d)) OR (duedate <5d and duedate>endOfWeek(-2d)))

The first part restricts the query to only this projects that you want to test. This is a great way of restricting down your test scope.

Then we have two similar conditions.

Let us look at the first one. 

(duedate <3d and duedate <endOfWeek(-2d)

In this we are checking for the duedate being within 3days AND that it is before the end of week -2days. The -2 days means we are checking is Friday or earlier. (Check what settings you have for end of week)

The second 

(duedate <5d and duedate>endOfWeek(-2d)

Here we push out the 3days to 5 days to allow for the weekend and check that the due date is after Friday. 

Let me know if this works for you or if not what challenges you experience. 

Thanks

Phill

0 votes
Rilwan Ahmed
Community Champion
September 1, 2023

Hi @Sorren Day ,

Welcome to the community !!

In native jira, there is no way to ignore the weekends in the JQL search. 

These 2 links will suggest some  workarounds provided by @Phill Fox. Check if it is helpful for you. 

https://community.atlassian.com/t5/Jira-Core-Server-questions/Exclude-weekends-in-JQL-Query/qaq-p/1030290 

https://community.atlassian.com/t5/Jira-questions/Need-filter-for-tickets-not-updated-for-last-3-days-excluding/qaq-p/1437566

Sorren Day September 1, 2023

Hi @Rilwan Ahmed 

 

Thank you for this. I think this is pointing me in the right direction, but I am stuck on how to convert it to my needs. I've tried tweaking the code and I am getting validated script, that brings back results, but I can't quite get it to bring back what I am expecting.

 

I need tasks/issues where the due date is less than 3 days from now, excluding Saturday and Sunday.

 

Thanks

Rilwan Ahmed
Community Champion
September 1, 2023

Hi @Sorren Day ,

In native jira, there is no way to exclude Saturday and Sunday in the JQL search. 

Sorren Day September 1, 2023

Hi @Rilwan Ahmed 

That was my understanding. I'm hoping the solution you linked to from @Phill Fox can be tweaked to achieve my requirement? I am just unsure how to do that. I need the code to look at the due date rather than the status, but when I try making that change it doesn't work.

 

Thanks

Suggest an answer

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

Atlassian Community Events