Java API code to create new incident

chitrat
Tera Contributor

Hi All,

Am new to ServiceNow and in the process valuating it.

Here my requirement is I need to create a new incident with the Java code.

Can anyone help me with the API Java code to create new incident on ServiceNow?

Thanks in advance

Chitra

1 ACCEPTED SOLUTION

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Chitra,



There is example java code here:


Table API Java Examples - ServiceNow Wiki



3.2 POST


..



Does that help answer your question?



Best Regards



Tony


View solution in original post

24 REPLIES 24

Hi Tony,



As we are able to access the URL https://dev13051.service-now.com/ from browser but when I am trying to access the complete URL from HTTP Client then its giving me the connection time out error.



I think already 443 is open for browser.



Could you please suggest on this.




Thanks



09890023363


Hi Shiv,



It could be a proxy is defined for your browser that allows access to the Internet.



In any case you should explain to your IT department that you require that non-browser traffic, in this case a java app, can access host dev13051.service-now.com on port 443 - and perhaps other hosts too.




Best Regards




Tony


The link provided by you is not functioning,, please can you share the code snippet to create the incident. Thanks

Harish KM
Kilo Patron
Kilo Patron

Hi Chitra,



Check this thread Re: How to create incident from a business rule?


Regards
Harish

chitrat
Tera Contributor

Hi Tony,



Now I am able to create/delete incident through API code.


Is there a provision to assign this incident to a particular user/user group through API code?


Is it possible to add some mandatory/necessary field value to a particular incident while creating it through API code ?



Thanks in advance


Chitra