REST API, creating incident with associated CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2015 04:13 AM
Hi community. I am new to Service Now so please forgive if this question has been answered - I found many close but all lacked the joined up view.
I am integrating our OSS platform to servicenow and am creating new CIs in the CMDB with the servicenow REST API (JSON) with no problems. (Full-fat management comes later but this is OK for now).
I can create incidents using the REST API also with no problems, but I need to attach the relevant CI to the incident. I capture the sys_id of the CI when I create it but looking at the incident dictionary I can't see anywhere I can pass the CI's sys_id so the newly created incident is "pinned" to the CI.
In a nutshell what I am trying to achieve is: Using the REST JSON API to create new incidents with the "Configuration Item" field populated by my integration ( I will be grabbing other stuff from the response also)
what am I missing?
thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2015 04:20 AM
On the Incident Table, there should be a column called cmdb_ci.
In the transform map, map your CI's SID to this field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2015 04:55 AM
Hi Subhajit, thanks for this.
I got to create the events using Mike's suggestion of using the CI name but I like absolutes - I really want to use the sys_id from when the CI was created.
In my transform map, the mapping assist doesn't show the field you say (or at least not as the field name) could you give me a bit of guidance?
(told you I was new 🙂
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2015 04:46 AM
Also, you do not have to use the sys_id. I pass the configuration item's name, which is our display value, and it transforms. Just put it in your transform maps "Field Maps" tab and it should move across.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2015 04:57 AM
In the target field, it will say Configuration Item, or whatever you have relabeled it to. In the source field, put your sys_id field from your import.