Use of ServiceNow with Rest API(using SOAP UI) to generate mails

nehasr1288
Tera Expert

Hi ,

I have a task to generate or rather insert incidents in Service Now using Rest API explorer from servicenow and soapUI tool.

As soon as incident is inserted from a soapui tool to service now a mail should be generated.

Please anyone know where to begin from?

1 ACCEPTED SOLUTION

Hi Neha,



Please pass the fields in the body of request as shown below, This worked for me.



1) Change media type to json and add your query


2) Add the content-type and accept headers



Rest API.jpg




Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

16 REPLIES 16

prashantnagaral
Kilo Guru

Hi Neha,



Refer below link for creating incident using REST explorer. There are some OOB notifications on incident which can trigger email when incident is created.



Getting started with REST - create an incident record



Hit like, Helpful or Correct depending on the impact of the response


Regards


Prashant


Alikutty A
Tera Sage

Hi,



For Rest, Go to Rest API Explorer under System Web Services module Select your table and create a POST request. Please refer to the link for more details



REST API explorer



For SOAP, you should import the WSDL file in SOAP UI tool and send the insert soap message for creating incident (Authorization is required) and the notification should be configured on your incident table.




Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


sujalavemula
Kilo Guru

Hi Neha,



Configure email notification that should be triggerred when the incident is created by the soap user.


You can write after/create BR with condition current.sys_created_by ==   // sys_id or user id of the soap user //   and trigger custom event using gs.addEventQueue() function and create email notification which is triggered when this custom even is called from this BR.



Hope this helps.


sujalavemula
Kilo Guru

to add to my above response, you need to first create inbound mapped web services or scripted web services to map source and target data and publish wsdl to target system or go to soap UI and load the WSDL generated & give the soap users credentials and run it.