Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,301,125
Community Members
 
Community Events
165
Community Groups

Exclude weekends in JQL Query for Service level agreements (Jira Software , Jira Cloud)

Edited

Here is my description.

We have a service level agreement (SLA) with our customer facing team. It says once the bug is created, within 3 business days, the status should move to  at least "IN-DEV" (closed is not possible as the Queue of tickets is long).

So we have created a custom field called as "SLA breach". This field should have "YES"  value if the duration between "NEW" and "IN-DEV" is longer than 3 business days (but exclude weekends).

Example:

  • If the new bug is created on Monday (then), it should go to "IN-DEV" before Wed (EoD), else on Thursday - it should be SLA breach.
  • If the new bug is created on Tuesday (then), it should go to "IN-DEV" before Thu (EoD), else on Friday - it should be SLA breach.
  • If the new bug is created on Wednesday (then), it should go to "IN-DEV" before Fri (EoD), else on Saturday - it should be SLA breach.
  • If the new bug is created on Thursday  (then), it should go to "IN-DEV" before next Mon (EoD), else on Tuesday - it should be SLA breach.
  • If the new bug is created on Friday  (then), it should go to "IN-DEV" before  next Tue (EoD), else on Wednesday - it should be SLA breach.
  • If the new bug is created on Saturday  (then), it should go to "IN-DEV" before  next Wed (EoD), else on Thursday - it should be SLA breach.
  • If the new bug is created on Sunday  (then), it should go to "IN-DEV" before  next Wed (EoD), else on Thursday - it should be SLA breach.

I know the Automation and I have created the cron jobs to run every night.

My problem is -3d is not excluding the weekend. (So A bug created on Friday, is flagged as SLA breach on Monday itself as Sat and Sun are counted by system)

Can you please suggest me a JQL filter to have the SLA breach for above conditions that will exclude weekends from the counting of "3 days"?

In other words I just want to count business days.

3 answers

0 votes

Hi, @Dipak Naokar 

I’ll try to help you. If I understand your problem correctly, it may be solved via plugins for Jira, for example, SLA Time and Report for Jira add-on. Here, if you want to count only business days and exclude weekends from the counting of "3 days", you just need to create a custom field called “SLA breach”. And this field should have "YES"value if the duration between "NEW" and "IN-DEV" is longer than 3 business days (but exclude weekends). This will perfectly work in SLA.

Here is a screenshot with possible conditions:

new in-dev.png

I hope this is what you need.

Also, this add-on is created by my SaaSJet team, so if you have any questions, I’m here to answer them.

@Olha Onofriichuk_SaaSJet 

Thanks for suggesting this app.

I have seen the details and it looks like a proper solution to the problem that I have raised.

But, the budget is a constraint hence we cannot go for the paid plug-in.

Hence I will keep looking for the answers for the JQL filters.

@Charlie Misonne Thank you.

I am looking for the solution using the JQL. (Not plugin as that would cost a few $).

Similar problems are available here but they do not have an answer to my specific query.

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

0 votes
Charlie Misonne Community Leader Jun 17, 2022

Hi @Dipak Naokar

This questions has been tagged with Jira Core so I asumme you are not using Jira Service Management. Are you aware that Jira Service Management has out of the box SLA's that can run in a certain time period (during business hours, week days only, ...).

If you can't use service management:

Here is a feature request similar to your question: JRASERVER-27539
A workaround with the endofweek() function is being discussed but I don't think it applies to you.
There might be plugins capable of it but I doubt you can do it with default JQL only.

@Charlie Misonne

Thanks for the quick response.

Actually the question is for "Jira software Cloud".

Let me check , if I can add or modify the tags.

Charlie Misonne Community Leader Jun 17, 2022

I can see you managed to change the tags. I also moved you question to Jira Software.

The default SLA's I mentioned are only available in Jira Service Management (not Jira Software) and support calendars to run an SLA in.

With Jira Software only you will definitely need some plugin.

Suggest an answer

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

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

219 views 2 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