How to filter current incident records based on caller?

I am using json web service for service - now to request incident records. I use java and apache Httpscomponents to make calls. There are a huge number of entries in the incident table, but I want to filter out the ones I need to work on. Using the wiki, I was able to get new entries. I want to get entries created / created by a specific user.

I call the form URL below when myUserName is the caller whose tickets I need to work on.

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

The problem is that I am still getting all new events, which means it sysparm_query=incident_state=1works, but one of them fails or drops.

Please tell me if my approach is wrong and point me aside, or if this is an error, what could be a correction in the URL?

+4
source share
2 answers

You can also use the query in this form to use caller_id if you needed to filter in this field:

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

This is useful because it can be used for other custom fields such as assign_to, etc.

+6
source

I found a solution for this question. In url, I had to give 'sys_created_by' or 'sys_updated_by' instead of 'caller'.

0
source

Source: https://habr.com/ru/post/1529773/


All Articles