Populate CMDB CIs based on the Selection of Service Field

Suraj Yadav1
Tera Contributor

Hi Everyone, 

I have a requirement for populating the CIs based on the Service selection.


For example -

If user selects "Service 1", so as per the configuration done in cmdb relationship table (i.e. Service 1 is parent of all the CIs), the specific CIs list should be populated in the CI field.

 

Please suggest me what should be my approach or best practice to take this ahead.

 

Thanks in advance.

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Suraj Yadav1 

 

Yes, it can be done, but you need to modify the OOTB configuration in this case. OOTB a CI is dependent on company

 

AGLearnNGrow_0-1742192566708.png

 

 

Where as you need it should depend on Service and it should depend on Service Offering So hirecacy is 

 

Service - Service Offering - CI  , you can build a logic for this.

 

https://www.servicenow.com/community/itsm-forum/auto-populate-configuration-item-field-based-on-serv...

 

https://www.servicenow.com/community/developer-forum/populate-business-service-based-on-ci-selection...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Tai Vu
Kilo Patron
Kilo Patron

Hi @Suraj Yadav1 

 

It seems like there's some confusion between populating values and lookup display. Since multiple CIs are related to a Service in the CMDB relationship table, how do you determine which specific CI should be populated into the CI field?

 

Could you clarify if you're looking to automatically set a CI based on the selected Service or simply filter the CI lookup list to show only related CIs?

 

Cheers,

Tai Vu

Hi Tai Vu san, 

I hope you are doing well,
I have created a relationship in CI Relationship table(cmdb_rel_ci), where with the help of parent & child field, we are defining the Service and CI field.
For Example : 
In Relation ship table, "Service 1" is treated as a Parent and Child will be CIs.
1. "Service 1" = Parent, CIs1 = Child
2.  "Service 1" = Parent, CIs2 = Child
3.  "Service 1" = Parent, CIs3 = Child

With the help of this relationship I have defined, I want to populate the CI based on the Service field selection on the Incident, Problem or Change form.

Hi @Suraj Yadav1 

 

The relationship is fine; the issue isn’t with the relationship itself. We had a similar issue on the client side.

Possible and complex solution:

  1. Select the Service / SO.
  2. BR – Which runs on the CMDB_REL table.
  3. Capture all dependent CIs in an array.
  4. If there’s only one CI, populate it.
  5. If there are multiple CIs, we cannot populate the value automatically. The user will need to select manually, but only the CIs that are dependent on the parent will be shown.
*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************