JQL filter - two SLA's
Asked by Jeferson Carlos dos Santos:

Hi guys, could you help me please?  
I'm trying to create a filter in jql to capture 2 SLas with violated status.  
But when I put the AND between the 2 slas, the filter doesn't return anything, but I know that both have violated tickets.  
If I use just one sla in the filter, it works, but if I add 2 it doesn't bring anything.  
Can you help me please? **( SLA 1 = T. Resolu??o 8h-17h, SLA 2 = T. Resolu??o 9h-18h )**

Thats the query:

*project = QTHD AND "Complexidade\[Select List (multiple choices)\]" in (Simples, Moderado, Avan?ado) AND created \>= -7d AND assignee in (631254c99794410874c65725, 627abf09694943006f34c127, 631254c809bc6014ea8b8ced, 62f51a0e96eb272011aab4af, 6409e7de0a4a47fb8d252bf5) AND "T. Resolu??o 8h-17h" = breached() AND "T. Resolu??o 9h-18h" = breached() ORDER BY created DESC*


Answers:
author: Mark Higgins
body: Hi Jeferson,

Just so I understand you would like issues to returns that have breached two SLA's.

In your select statement there is:

Project = "QTHD" and Field in (list) and created \< -7d and assignee jn (x,y,z) and an SLA that has '8h-17h' has breached and an SLA that has '9h - 18h' has breached()

So, when you have one or the other SLA then rows are returned, but when you have both, its empty?

I assume you are looking for issues that have breached both SLA's? and that you can see issues that that appear in both queries?

If you tried (SLA 1 OR SLA 2), does it being back both sets?

Mark

comments: author: Jeferson Carlos dos Santos
body: Hi [@Mark Higgins](/t5/user/viewprofilepage/user-id/3517340)

That's right, I want to filter 2 SLas, I tried to do SLA 1 OR SLA2, and it worked, but it seems that it ignores the ticket creation time that I want to be filtered for the last 7 days.  
When I filter using only 1 SLA it filters correctly.

I don't know why this is happening.


author: Mark Higgins
body: Hi [@Jeferson Carlos dos Santos](/t5/user/viewprofilepage/user-id/4968071)

I'm trying to reproduce what you are seeing in my test site.

So, I have two SLA's - one that shows unresolved tickets and "time to resolution" \< remaining("2h") - which when I run as a stand-alone it returns - 16 rows

The second SLA is "time to first response" = breached()) - when I add this as an 'or' I get 28 rows, when I add it as an 'AND', I get 15 rows.

project = "IT Support" and (resolution = Unresolved AND "Time to resolution" \< remaining(2h)) or ("Time to first response" = breached()) - 28 rows

project = "IT Support" and (resolution = Unresolved AND "Time to resolution" \< remaining(2h)) and ("Time to first response" = breached()) - 15 rows

So here we have two SLA's and they do work as expected, togeather.

Can you provide the JQL, so I can try and reproduce it here?

Do both SLA's use the same calendar?

Cheers

Mark


author: Jeferson Carlos dos Santos
body: Hi [@Mark Higgins](/t5/user/viewprofilepage/user-id/3517340) ,

Sure!

Thats the JQL that I am using:

*created \>= -7d AND project = QTHD AND "Complexidade\[Select List (multiple choices)\]" in (Simples, Moderado, Avan?ado) AND assignee in (6409e7de0a4a47fb8d252bf5, 62f51a0e96eb272011aab4af, 631254c809bc6014ea8b8ced, 627abf09694943006f34c127, 631254c99794410874c65725) AND "T. Resolu??o 9h-18h" = breached() OR "T. Resolu??o 8h-17h" = breached() ORDER BY created DESC*

Each SLA uses a different calendar.


author: Jeferson Carlos dos Santos
body: Hi [@Mark Higgins](/t5/user/viewprofilepage/user-id/3517340)  
Any updates? I'm still having a lot of trouble solving this problem and I don't know what else to do.


Tags: cloud

jira-service-management

jira-service-management-cloud