How do I know if the CI has Incident, Problem, Change tickets?

Paul125
Kilo Guru

I have a WebServers CI table that holds more than 1500+ CI records. Is there any possible way where I can check the existing Incident, Change, Task tickets related to each CI rather than going into each CI's related list to confirm. Like script or something that can help?

Thanks.

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Rick,

 

Try using background script as below:

 

var task1=new GlideRecord('task');
task1.addEncodedQuery('Paste necessary query');
task1.query();
while(task1.next())
{
gs.print('Task number with CI is '+task1.number + '& is an '+task1.sys_class_name);
}

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

View solution in original post

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

Hi Rick,

 

Try using background script as below:

 

var task1=new GlideRecord('task');
task1.addEncodedQuery('Paste necessary query');
task1.query();
while(task1.next())
{
gs.print('Task number with CI is '+task1.number + '& is an '+task1.sys_class_name);
}

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

I think you haven't read my question properly.

 

Thanks.

You could create a view between your WebServers CI and the task table where the sys_id from the WebServers CI tables = cmdb_ci filed on the task table.  Then create a report off the view.  Also so you could use it for every CI class you could base the view off the cmdb_ci table instead then you could run the report for any class.