Affected CI & auto populated of Impacted Services ?

sukran
Mega Sage

Hi All ,

We try to auto populate the Impacted services based on affected CI in change/incident form , How to achieve this ?

As of now , if we choose CI in configuration item field , it will show the same CI in affected CI tab & want to populate impacted services related this CI

 

We have dependency map/relationship in CMDB , but we don't have Service mapping ITOM

1 ACCEPTED SOLUTION

Hi,

Steps below

1) create after insert BR on task_ci table with valid condition so that it works only for INC and CHG

2) then for each insert insert record into task_cmdb_ci_service with the value from CI and Task from Task CI Table

Condition: current.task.number.startsWith('CHG') || current.task.number.startsWith('INC')

Script:

(function executeRule(current, previous /*null when async*/) {

    // Add your code here

var gr = new GlideRecord('task_cmdb_ci_service');

gr.initialize();

gr.cmdb_ci_service = current.ci_item;

gr.task = current.task;

gr.insert();

})(current, previous);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

13 REPLIES 13

@Ankur Bawiskar - no problem, Thanks for your help

you are a lion 🙂 , just want to update here

Glad to help

Thanks for the compliment

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar  - i found an answer in community

 

There is script include called ciUtils that automatically walks up the tree using cmdb_ci_rel table and looks for all services under cmdb_ci_service table

 

 

 

  var ciu = new global.CIUtils();

 

  var services = ciu.servicesAffectedByCI(current.cmdb_ci); // change current.cmdb_ci according to the affected ci column

 

 

Here we dont have any record in ( cmdb_ci_service) table - business service , my question is this related to Service Mapping & required to install any plugin ?

 

 

 

Returns an array of services affected by the CI

Hi,

not much sure on the plugin and the Service Mapping module.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader