Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JQL for showing all service requests in a single queue

Juuso Ikonen November 3, 2021

Hello!

I am trying to create a queue to show all service requests in a single page, regardless of who the assignee is or what the status is (all unresolved ones only, naturally). This is meant for our service desk function where requests are taken care of collectively.

I've hit a snag, though.

```
Status is not ("Closed","Resolved") AND labels not in (feature_request) OR labels is EMPTY
```

This is what I'm attempting to run at the moment. That one label has to be excluded since SD doesn't handle them. With this query I should be able to view all requests, since the default values that can't be changed are already:

```
This queue is already filtered by:project = "PROJECT NAME" AND "Ticket category" = "Service requests"
```

However, this does not filter out Closed and Resolved status requests for some reason. If anyone can spot the error here, I'd be much obliged.

EDIT: Decided to go ahead and test

```
resolution = Unresolved AND labels not in (feature_request) OR labels is EMPTY
```

as well, but no dice. Had the wrong operator in labels as well.

2 answers

1 accepted

3 votes
Answer accepted
Gaurav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 3, 2021

Hello @Juuso Ikonen 

While you are trying Status is not ("Closed", "Resolved"), I would suggest you try it as Status not in (Closed, Resolved).

I do not have the labels implemented in my environment but using the JQL as below does provide the required output.

project = "ITSM project" and "Ticket category" = "Service requests" and Status not in (Closed, Resolved)

Let me know if this helps.

Kindly accept the answer if the required output is achieved.

Juuso Ikonen November 3, 2021

Thank you for answering.

"The value 'Closed' does not exist for the field 'Status'."
Unfortunately, this doesn't seem to compute.

Status not in (Resolved)
Gives the same results as before; all requests that do not have the label attached or has the label as empty, but also all Resolved requests.

It's honestly a bit odd, since 
Status in ("Waiting for support", "In progress", Escalated, Pending) AND labels not in (feature_request) OR labels is EMPTY
also gives these same results, though the status is stated clearly in this case.

Like Marjorie likes this
Gaurav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 3, 2021

@Juuso Ikonen 

Try adding the condition on labels in a bracket like

Status in ("Waiting for support", "In progress", Escalated, Pending) AND ( labels not in (feature_request) OR labels is EMPTY)

I believe this will get you the required result set.

If it works, I would suggest you change the condition on Status as well and try that as well.

Please let me know how it goes.

Like # people like this
Juuso Ikonen November 3, 2021

Yes, this fixed the issue, though I do not yet understand the logic behind this. Thank you, Gaurav!

I can't tag this response as the answer, so I'll tag your first message as the answer instead.

2 votes
Gaurav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 3, 2021

Hello @Juuso Ikonen 

Let me try and explain this, the query was running fine till all AND conditions but at the point where it found the OR condition, it considered everything before the condition as statement 1 and everything after the condition as statement 2. Then, it returned you results of 'Statement 1 OR Statement 2'.

 With the addition of brackets, the OR condition was limited to the part of the label only and expected output was received.

I hope this explains and helps you going forward.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events