- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2015 02:44 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2015 03:02 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2015 03:02 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2015 05:03 AM
Hi Tony,
Its close enough.This is what I want.
I tried to run the code from my eclipse and am getting the below error
"
Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.impl.conn.HttpClientConnectionOperator.<init>(HttpClientConnectionOperator.java:74)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
at chitra.iopex.com.GetAction.postRequest(GetAction.java:34)
at chitra.iopex.com.GetAction.main(GetAction.java:22)
"
Searched for this error but no solution is working.
Any idea ?
Thanks
Chitra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2015 05:08 AM
Hi Chitra,
Good to hear it is useful for you.
Have you updated this line to point to the actual URL of your instance?
HttpMethod method = new PutMethod(
"https://instance.servicenow.com/api/now/table/incident/8190e877d7031100261253b2b252033e");
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2015 05:14 AM
HTTPClient jar file is the issue.
Changed the jar file version from httpclient 4.3 to 4.3.3 and its working now.
Thanks Tony