Auto creation incident through REST API integration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 01:53 AM - edited 02-23-2023 02:00 AM
Hi Team,
Please help me on below requirement.
Q) When third party tool sends an json file, We need to check service now side Ci is operational or not. If Ci is operational we need to create incident in serviceNow.
If CI is not operational it needs to be failed and send mail to xyz group msg like due ci is not valid like that.
Thanks in advance,
- Labels:
-
Architect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 03:26 AM
Hi Adrian,
Thanks for quick response.
We need to configure these to through scripted REST API. We have created REST user and REST pwd and provided to them.
Please help me this .
Thanks in Advance,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 03:58 AM
Also you should provide an endPoint and an operation (PUT/POST) for this. Are they able to connect with you?
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2023 01:37 PM
Many ways to process payloads for producing records from the examples others have provided. But your original question was how to determine if a CI is operational or not from that REST integration. This is something that can be exposed as a single query against the CI class table you want for that CI and returns a TRUE/FALSE to support the logic flow in the integration.
If the 3rd party tool does not know the Sys_ID or GUID of the CI, or what Class Table to check for operational status attribute, you can also expose a re-usable Custom DB View that can be called/searched against via API that only presents ALL CI's that are Operational (sys_id, name, table name, etc.). If the integration can't find it from searching that view, you can assume it is not Operational or that your unique search data is possibly wrong, or the CI Does not exist. Better to fail unless 100% sure and retool criteria or improve data quality to find a match.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2023 05:42 PM
@sukanya kotni here, you can use transform map script on before , I believe there is a stagging table rest_api_incident that is source table.
So user source.cmdb_ci to get ci name, and add your logic using gliderecord,if fails then
add error here and then ignore to stop next
Ignore=true;
Hope this will help you.