logo

NJP

Refresh Impacted Services Improved outcome

Import · Dec 07, 2022 · article

In Incident mgmt as well as Change mgmt the Refresh Impacted Service action results in unexpected output. I show this by example sing this service model:

BarryKant_0-1667550093453.png

When using system properties like:

Sys Properties Value
incident.refresh_impacted.include_affected_cis TRUE
com.snc.incident.populate_service_offering TRUE
com.snc.incident.populate_business_application TRUE
Incident Test 1 Test 2
Service Product Quality Compute Services
Service Offering PPQ – Non Prod Windows Hosting
Configuration Item Server ABC Server ABC

The Output of Resfresh Impact Service is:

Real Output

Test 1 Test 2
Impacted Services/CIs Product Quality ( Manual ) Compute Services ( Manual )
Service Offerings PPQ – Non Prod ( Manual)PPQ Windows Hosting ( Manual)Linux Hosting (?) Terminal Hosting (?) Virtual Clients (?)
Business Applications PPQ PPQ

Why would Linux Hosting be affected based on a Windows Server CI as input...

Expected Output

Test 1 Test 2
Impacted Services/CIs Product Quality ( Manual ) Compute Services ( Manual )
Service Offerings PPQPPQ – Non Prod ( Manual ) Windows Hosting ( Manual)PPQPPQ – Non Prod
Business Applications PPQ PPQ

The used logic is:

TaskOfferingSNC (Script Include)

...... getOfferings: function(services) { var offeringGr = new GlideRecord('service_offering'); offeringGr.addQuery('parent', "IN", services); offeringGr.query(); var offeringArr = []; while (offeringGr.next()) offeringArr.push(offeringGr.getUniqueValue()); return offeringArr; }, type: 'TaskOfferingSNC'}; type: 'TaskOfferingSNC'};

it simply all Service Offerings where the parent is the Service from the busines_service attribute (--> synced to task_cmdb_ci_service table).

as it is an SNC script we can remediate it easily like in the Script Include:

TaskOffering

var TaskOffering = Class.create();TaskOffering.prototype = Object.extendsObject(TaskOfferingSNC, { initialize: function() { TaskOfferingSNC.prototype.initialize.call(this); }, getOfferings: function(services) { var ServiceOfferings = []; if (services) { var relGR = new GlideRecord('cmdb_rel_ci'); relGR.addQuery('parent.sys_class_name', 'service_offering'); relGR.addQuery('child.sys_id', 'IN', services); relGR.query(); while (relGR.next()) { var parent = relGR.parent.sys_id.toString(); if (ServiceOfferings.indexOf(parent) == -1) ServiceOfferings.push(parent); } } return ServiceOfferings; }, type: 'TaskOffering'});

To enhance this capability this idea is made.

You can Vote for it if you think it makes sense.

View original source

https://www.servicenow.com/community/common-service-data-model/refresh-impacted-services-improved-outcome/ta-p/2372527