Auto creation incident through REST API integration

sukanya kotni
Tera Contributor

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,

 

8 REPLIES 8

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,

Also you should provide an endPoint and an operation (PUT/POST) for this. Are they able to connect with you?

If it was helpful, please give positive feedback! ✔
☆ Community Rising Star 22, 23 & 24 ☆

Oddeoh
Tera Contributor

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.

Abhay Kumar1
Giga Sage

@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.