- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 02:04 PM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 11:54 AM
Hi Steve - you could use the combination of a Dynamic Reference Qualifier + Script Include, but here's a simpler solution:
- The Incident table already has Business service [business_service] field (inherited from the Task table). Add this field to the Incident form.
- 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); - Save the Dictionary changes.
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2023 03:30 AM
Hello @drjohnchun
I have similar type of requirement .i have created three custom fields.
1]configuration items which is referring cmdb_ci table
2]parent ci
3]child ci
so when a user selects a configuration item based on that configuration I want to show related child ci and parent in respective fields. I spent a lot of time on this but not getting expected output.
please guide me on this.
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2023 07:50 AM
Hi John,
Can you please help me out with the function servicesAffectedByCI to return the value in a on change client script so that if there is only one matching service then auto populate the Service else show the list as a reference
I cant seem to figure out and make changes to the function as per my requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2017 02:04 PM
Steve, included out of the box is a script included called CIUtils that can help you with this. The "Refresh Impacted Services" that John Chun mentions utilizes this script include. Basically it will leverage the CI relationships to go up the hierarchy and provide you with a listing of the services associated to your CI. You can read more about it here:
You will want to leverage the servicesAffectedByCI function and pass it the current.cmdb_ci. So for example:
var serviceIDs = new CIUtils().servicesAffectedByCI(current.cmdb_ci);
An array will be returned so if you have more than one service associated, you can loop through them or you can just set it to the first one like:
current.business_service = serviceIDs[0];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 06:50 AM
Michael,
Thank you for the advice, I think we will try going with this method. Would this be a UI Script that would be run on the Incident form or how would we implement the code?
Cheers,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2018 01:38 AM
Hi,
I have the same question. I know the Configuration Item and want to populate the corresponding the Business Service Offering. I want to do this by using the REST API calls.
For example:
By using https://community.servicenow.com/community?id=community_question&sys_id=f5d64ba5db1cdbc01dcaf3231f9619c2 I can get the user sys_id based on user name.
I am looking for a corresponding REST API calls.
Thank you in advance,
Levent