Question

I'm using json web service for service-now to query on the incident records. I'm using java and apache Httpscomponents to make calls. There are huge many records in the incident table, but I want to filter the ones which I need to work upon. With some help from the wiki I was able to fetch the records which are newly added. I want to fetch the records called/created by a particular user.

I make calls on the URL of the form below with the myUserName being the caller whose tickets I need to work upon.

https://<instance>.service-now.com/incident.do?JSON&sysparm_action=getRecords&sysparm_query=incident_state=1%5Ecaller=myUserName

The problem is that I'm still getting all the incidents that are new, meaning the sysparm_query=incident_state=1 is working but the one afterwards fail or gets omitted.

Please tell me if my approach is wrong and point me in the direction, or if its a mistake what might be the correction in the URL?

Was it helpful?

Solution

You could also use a query in this form to use the caller_id if you needed to filter on that field instead:

&sysparm_query=incident_state=1^caller_id.user_name=youruserid

This is useful since it can be employed for other user fields such as assigned_to, etc.

OTHER TIPS

I've found the solution for that question. In the url I should have given 'sys_created_by' or 'sys_updated_by' instead of 'caller'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top