Jump to content
Sign in to follow this  
Alisha

Error in widget - critical incidents

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

Share this post


Link to post
Share on other sites

Hi @Alisha

When you say "it no longer works" - does that mean there is an error message appearing or that it returns no results when you are expecting some?

Do you currently have any open Critical requests on the system that should be returned?

Kind Regards

Bob

Share this post


Link to post
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

Share this post


Link to post
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")

Share this post


Link to post
Share on other sites

I somehow made it work by adding:

AND h_requesttype = "Incident"

And removing:

AND h_sub_status IN ("Parent - With Third Party", "Parent")

I'm not sure why that worked but it has!

Share this post


Link to post
Share on other sites

Hi @Alisha

Great news - I'm not sure why either, I was unable to replicate this. 

Please let us know if you experience any further issues

Kind Regards

Bob

  • Thanks 1

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...