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
Community Members
Community Events
Community Groups

JQL for determining time of SLA breach

On the first of each month, I want to pull a query of all issues that breached SLA for the previous month.  Specifically, I want to know all issues that breached and were resolved, as well as those that breached and are still unresolved.  However, when I run the query the following month, I don't want to count issues that are still in breach from the previous month.

For example, on February 1st, I query January, and I find Issue #1 and #2 breached and were resolved in January, and Issue #3 breached in January, but it was NOT resolved.  My January report should show Issues #1, #2, and #3.

Then, on March 1st, I query February, and Issue #3 is still unresolved.  No other issues breached or were in breach in February.  My February report should have NO issues.

It's easy to get the ones that breached and were resolved using:

project = "MyJSM" and "TimeToResolution" = everBreached() and
resolutiondate > startOfMonth(-1) and resolutiondate <= endOfMonth(-1)

but I'm looking for something like a "dateBreachStarted" column for that TimeToResolution SLA so I can do this:

project = "MyJSM" and "TimeToResolution" = everBreached() and
dateBreachStarted > startOfMonth(-1) and dateBreachStarted <= endOfMonth(-1)

 Any help would be appreciated.

1 answer

1 accepted

2 votes
Answer accepted

I see that @Jerry O'Sullivan just asked this question a few days ago right here:  


We're each seeking the same golden egg...

Workaround here - 


Hope this helps!

@Jerry O_Sullivan Yes, it did.  Specifically, for those who wish to do it themselves:

  1. Created a custom field, FirstBreachDate
  2. Populated FirstBreachDate with historical dates for issues that had breached in the past.  This data was inexact; I just needed it to be in about the right month.
  3. Created a "SLA threshold breached" automation that populates FirstBreachDate if the values has not previously been set.

Then, issuing a JQL query is really easy:

project = "MyJSM" and "TimeToResolution" = everBreached() and
FirstBreachDate > startOfMonth(-1) and FirstBreachDate <= endOfMonth(-1)

And, in fact you don't even need the  "TimeToResolution" = everBreached() because the presence of a FirstBreachDate value indicates a breach has occurred.

Note that if you have multiple SLAs, this triggers ONLY on the first breach of ANY SLA.  If you need to care for FirstBreachDate by SLA, you'd need to do a bit more.

Suggest an answer

Log in or Sign up to answer
Site Admin

Atlassian Community Events