Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Exclude weekends in jql query

I have a user that wants a filter to manage the SLA for their dept. But they want to exclude weekends. This is what we came up with, any ideas how to exclude weekends now?

project = INC AND status = Open AND Delegation = "CPE Incident" AND created <= -24h OR status = Assigned AND Delegation = "CPE Incident" AND created <= -48h OR status = "In Progress" AND Delegation = "CPE Incident" AND created <= -48h

2 answers

Hi @Dan Buffham1 

This is probably way too late to help you but I will put an answer in here for anyone else who finds this question. 

If you I understand your criteria correctly they want 

project = INC AND status = Open AND Delegation = "CPE Incident" to have an SLA of 24h Mon-Fri but no counting of Saturday/Sunday and they are looking for items that meet that criteria (I have ignored the other variants of Delegation for now).

So we can split the criteria in to three parts issues raised on Monday-Thursday current week

(created <=-24h and created >startOfWeek())

now lets look at issues raised on Friday

(created <=-72h and created >startOfWeek(-2d) and created <startOfWeek())

What this does is uses the 72h period to ignore Sat/Sun for any ticket created on the previous Friday 

and everything earlier

(created <=-24h and created <startOfWeek(-2d))

Putting all three parts together you get 
(created <=-24h and created >startOfWeek()) OR (created <=-72h and created >startOfWeek(-2d) and created <startOfWeek()) OR (created <=-24h and created <startOfWeek(-2d))

 

Regards

 

Phill

Hey @Phill Fox ,

 

great idea to share your knowledge even 5 years later :DDD.

I was just looking for exactly that filter, not with created but with updated, but it works the same way :).

 

Thanks a lot and BR

Franzi

Hi @Franzi Jos 

I am glad to have helped you. Using the startOfWeek and endOfWeek functions can be tricky to get your head round at first but they are super powerful along with the ones for Day/Month. 

kind regards

 

Phill

Like Franzi Jos likes this

Hi Phill, I have another scenario wherein I need to check if an issue is beyond the SLA, here again, i need to exclude the saturday and sunday based on the creation date. For example, if the priority of an issue is Critical, we need to resolve this within 1 day. If it has passed one day and the issue is still open then we tag them. 

Currently, I have this query...created <= endOfDay(-2d) AND priority = Critical. This works great but it doesnt take into account the weekends. So if the defect was created on a friday it starts tagging on a saturday if it is still open but I want it to tag on Monday by excluding saturday and sunday. 

Is there anyway I can do this with your above resolution in addition to my query 

created <= endOfDay(-2d) AND priority = Critical 

Hey Dan,

Its a requested feature (see here) but the closest thing to it can be found here: https://answers.atlassian.com/questions/38644

 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

321 views 9 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you