Jump to content

Error in widget - critical incidents


Alisha

Recommended Posts

Hello,

I'd like a widget so we can see all Critical Incidents. My original widget is as follows and this seems to work fine.

SELECT h_pk_reference AS 'Open Critical Incidents', h_summary, h_fk_team_name FROM h_itsm_requests
WHERE h_fk_servicename = "IT Services"
AND h_fk_priorityname = "Critical"
AND h_status IN ("status.new", "status.onhold", "status.open")
AND h_sub_status IN ("Parent - With Third Party", "Parent")
ORDER BY h_pk_reference DESC

However, when I remove one line (see below) because we don't actually want the sub-status in there, it no longer works. Does anyone know why please?

SELECT h_pk_reference AS 'Open Critical Incidents', h_summary, h_fk_team_name FROM h_itsm_requests 
WHERE h_fk_servicename = "IT Services"
AND h_fk_priorityname = "Critical" 
AND h_status IN ("status.new", "status.onhold", "status.open") 
ORDER BY h_pk_reference DESC

Many thanks,
Alisha

Link to comment
Share on other sites

Hi @Bob Dickinson,

Thanks for your quick response.

I receive the below error when I remove that one line.

We do currently have an open Critical Incident and that does appear on the widget when using the full query.

We do actually have two services listed, and when I removed one it started to work. Is it not possible to have the below line at the beginning?

WHERE h_fk_servicename IN ('Service Name 1', 'Service Name 2')

For example:

SELECT h_pk_reference AS 'Open Critical Incidents', h_summary, h_fk_team_name FROM h_itsm_requests 
WHERE h_fk_servicename IN ("Service Name 1", "Service Name 2")
AND h_fk_priorityname = "Critical" 
AND h_status IN ("status.new", "status.onhold", "status.open") 
ORDER BY h_pk_reference DESC

Many thanks,
Alisha

Hornbill Error.jpg

Link to comment
Share on other sites

@Bob Dickinson I have also tried changing it to the following and that seems to work.

WHERE h_fk_priorityname = "Critical"
AND (h_fk_servicename ="Service Name 1" OR h_fk_servicename ="Service Name 2") 

But as soon as I remove the below, I get the error again.

AND h_sub_status IN ("Parent - With Third Party", "Parent")
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...