Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Does the REST API support adding/deleting relationships between CIs?

kevin_leuthold
Kilo Contributor

I'm wondering if it's possible to add or delete a relationship between configuration items using the REST API. For example, I'd like to add a parent-child relationship between two applications.

1 ACCEPTED SOLUTION

Mike Allen
Mega Sage

Relationships are held in a table.   All tables have open APIs.   So, theoretically, yes, you can do it.   The table is cmdb_rel_ci, so the open table api would be https://instance.service-now.com/api/now/table/cmdb_rel_ci


View solution in original post

2 REPLIES 2

Mike Allen
Mega Sage

Relationships are held in a table.   All tables have open APIs.   So, theoretically, yes, you can do it.   The table is cmdb_rel_ci, so the open table api would be https://instance.service-now.com/api/now/table/cmdb_rel_ci


Constantine Kr1
Giga Guru

There is a fairly new alternative way of doing this through the CMDB Instance API (this can be further explored in the REST API Explorer). 

 

https://docs.servicenow.com/bundle/madrid-application-development/page/integrate/inbound-rest/concep...

 

Here is an example from Knowledge 18 lab manual using the API:

https://developer.servicenow.com/app.do#!/creatorcon/CCW1127/creatorcon_18_CCW1127_lab_52__delete_re...