SNC.ImpactManager()

Joe P1
Kilo Contributor

I'm looking for the API documentation for SNC.ImpactManager(), particularly the implementation of getCisInActiveChangeWindow()

How does this calculate the CIs to return?

1 ACCEPTED SOLUTION

moshe_d
ServiceNow Employee
ServiceNow Employee

Hi

 

the getCisInActiveChangeWindow will return all the CI's that are in the following  states:

(SCHEDULED, IMPLEMENT, WORK_IN_PROGRESS, and OPEN) and are approved

also, the time frame that the change is defined on is now

 

If u can show me the other documentation on ImpactManager I will try to ask to publish that as well

Regards

  • Add to Phrasebook
     
    • No word lists for English → Hebrew...
       
    • Create a new word list...
  • Copy

View solution in original post

9 REPLIES 9

The scripts we can modify call this function.  The implementation, or at least the return values, should be documented.

moshe_d
ServiceNow Employee
ServiceNow Employee

Hi

 

the getCisInActiveChangeWindow will return all the CI's that are in the following  states:

(SCHEDULED, IMPLEMENT, WORK_IN_PROGRESS, and OPEN) and are approved

also, the time frame that the change is defined on is now

 

If u can show me the other documentation on ImpactManager I will try to ask to publish that as well

Regards

  • Add to Phrasebook
     
    • No word lists for English → Hebrew...
       
    • Create a new word list...
  • Copy

Joe P1
Kilo Contributor

Thank you.  This is exactly what I needed

I have created a simple fix script and the results are as follows

1. If a configuration item (cmdb_ci) is populated on a change request record that is in implement state then it gets picked up by the function getCisInActiveChangeWindow of script SNC.ImpactManager()

2. It doesnt pickup any CIs that are in task_ci table for a change request in implement state or any other open states such as scheduled and so on.

3. It doesnt pick any impacted services that are in task_cmdb_ci_service table for a change request in implement state or any other open states such as scheduled and so on.

 

you can test it on any of your PDI or client instance by running this fix script

gs.info(getCis());

function getCis() {

var impactManager = new SNC.ImpactManager();

var cis = impactManager.getCisInActiveChangeWindow();

return cis;

}

// Above function returns Cis in a array format ['ci_sys_id1', 'ci_sys_id2',....]

 

The Above script is not pulling my active change(Implementation state) and not the affected CI's from the task_cmdb_ci table.. could you please help me to understand this