Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get the list of CI's from service offering

rahul16
Giga Guru

I want to create a reference qualifier for the incident table that if a user selects service and service offering then under configuration items I have to get all the CI's based on the service offering.

As per my understanding Business applications will be CI.

So how can I relate service offering to business applications or what is the relation between service offering and CI's?

5 REPLIES 5

Brian Lancaster
Kilo Patron

What if you data model for know what CI's belong to the Service Offering? Do you have CI relationships setup between these?

I have created mapping like this 

  1. business application to application service --> runs on

  2. business service to business application --> Depends on

  3. service offering to application service --> contains

This is will work best if the CI field is a reference filed. You will need to call a script include that queries the cmdb_rel_ci table where the parent is service offering and type is contains. Then you will need to return an array of sys_ids. The code for the return of the list of sys_ids would look something like this.

return "sys_idIN"+id.join();

where id is your array.

so from the above query, I will get the list of application services only.

What if I want to get a business application