Barry Kant
ServiceNow Employee
ServiceNow Employee

Symptoms

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

 

 

 

 

 

Diagnosis

 

Lets create 2 tickets with this data (1 acting as user, 1 acting like event driven)

Test Incident data

 

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

PPQ

PPQ – Non Prod ( Manual )

Windows Hosting ( Manual)

PPQ

PPQ – Non Prod

Business Applications

PPQ

PPQ

 

 

 

 

Solution

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. 

 

 

Comments
Johannes
Kilo Sage

Hi @Barry Kant and thanks for this article!

I am not able to see the details in the picture, seems like max resolution is 469x294. Could you maybe provide a higher resolution picture, if it is just not me having this issue?

Barry Kant
ServiceNow Employee
ServiceNow Employee

Hi Johannes,

is this working better?

 

Bug-Example.png

 

Cheers,
Barry

Johannes
Kilo Sage

Perfect, thanks!

dick linschoten
Giga Guru

@Barry Kant interesting topic, I'm looking at a kind of same issue do you think it's related
my case based on your picutre
registering an incident on server ABC and refreshing the impacted services 
my expectation is that I see as affected services PPQ QA an PPQ prod which works 
I would also expect to see in either the impacted services list or in the service offering 
PPQ (BSO) and PPQ- non prod (BSO )

and mostlikely also PPQ- l2 (TSO) 

but I only see the 2 reated AS in the impactes services

Barry Kant
ServiceNow Employee
ServiceNow Employee

Hi, not 100% sure but let's see.

If the properties are like this:

Sys Properties

Value

incident.refresh_impacted.include_affected_cis

TRUE

com.snc.incident.populate_service_offering

TRUE

com.snc.incident.populate_business_application

TRUE


then it splits the Impact Analysis results across 2 related lists:

  • task_cmdb_ci_service
  • task_service_offering
  • task_business_application

Not sure If you have the last 2 in the related lists:

Screenshot 2023-03-06 at 13.14.05.png

 

If you have the Service Offering related list added then you will see the PPQ (BSO) and PPQ- non prod (BSO ) if the Incident is registered on the Service: "Product Quality" (BS).
If the Incident is registered on the Service: "Windows Hosting" (TS) then it will show:

  • Windows Hosting
  • Linux Hosting
  • Terminal Hosting
  • Virtal Client

as impacted Service Offerings. Which is incorrect and then you can add the fix as described.

 

Success,
Barry

 

dick linschoten
Giga Guru

@Barry Kant that works indeed but not fully what I meant.
Say incident is registered on TS/TSO windows hosting
and configuration item server xyz.

in the result i see 
affected ci (1) --> server xyz

impacted services (3) --> ppq-QA; windows; ppq-prod
service offering (1) --> windows  hosting

 

I would expect either in impacted services or in service offering 
the other related Service offers like ppq non prod and ppq prod, 
this to be able to identify what customers might be impacted

 

dick linschoten
Giga Guru

@Barry Kant based on our discussion I've played with this solution and that works ok. 
additionally a question on this topic what is your expectation and how it should work.

say that in this example the windows servers are virtualised. and the incident is raised on the vm esx server
my expectation would be that on the affected services I whould also see the same result as when it would be directly on the windows as depicted in your example

but when I model this I don't get a result on the impacted services

Barry Kant
ServiceNow Employee
ServiceNow Employee

@dick linschoten 

most likely the ESX server is hosting many servers, and the impact will be shown accordingly. So impact to many servers means potential impact to many applications.

BR,
Barry

Version history
Last update:
‎11-04-2022 01:28 AM
Updated by:
Contributors