Populate Business Service Based on CI Selection

Steve Kelly
Mega Sage

Hi all,

New to ServiceNow, and am in the set up and configuration stage. Here is what we would like to do:

On the Incident form, we would like Business Service to be populated, based off the Configuration Item that is selected. This would

only apply wherever there is a relationship between the CI and a Business Service (we have all of our Applications and some other CI types

related to a Business Service. The relation ship is usually Business Service depends on CI).

From researching I see this is probably possible using business rules with a script or with some use of dot-walking or both. Anyone have a

suggestion here?

Much appreciated,

Steve

1 ACCEPTED SOLUTION

Hi Steve - you could use the combination of a Dynamic Reference Qualifier + Script Include, but here's a simpler solution:



  1. The Incident table already has Business service [business_service] field (inherited from the Task table). Add this field to the Incident form.
  2. Configure the Dictionary settings for the Business service field as below in the Reference Specification tab (you   need to use the Dictionary's Advance view to see these fields):
    Reference: Business Service
    Use reference qualifier: Advanced
    Reference qual: javascript:'sys_idIN' + new CIUtils().servicesAffectedByCI(current.cmdb_ci);
  3. Save the Dictionary changes.
  4. Open a new or existing Incident form and test. In case a CI is not related to any Business Service, the list won't show anything.


find_real_file.png


View solution in original post

24 REPLIES 24

Glad to be of help. Would you mark the reply as answer if appropriate? Thanks.


I'd like to point out that we made the changes to a field in the Task table, which means all tables that extend from the Task table will inherit the settings (there are quite a few such tables, including Change, Problem, Request, etc.). In case you want the behavior confined to Incident only, you'll have to use a Dictionary Override.


Thanks John, we actually wanted that behavior so this worked out perfectly!


Hi John



I am looking at something similar, though I want to select the Ci based on the Business Service.



I have the Business Service (u_business_service) and the Affected Ci (cmdb_ci), both extended from the task table.



find_real_file.png



find_real_file.png



Would the ref qualifier be something similar?


javascript:'CIUtils' + new sys_idIN().CIAffectedByService(current.u_business_service);


Though this clearly doesn't work.



Am I trying to be too simplistic?



Thanks



Chris


Hi Chris,



The CIUtils class doesn't have a built-in method for CIAffectedByService, so you'll have to create your own. One challenge here is there may be a lot more CIs for a service than the other way around, so you may run into performance issues if you're doing this in real time. You can lessen the impact by specifying which class/type of CIs to return or limit to only so many generations of descendants to search.



Hope this helps.



John