Trying to pull all Incidents from Service Now via the Web API that is NOT closed.
I know that Squared Up KB regarding Service Now states that you should used Sysparm_query “Active=True” for open incidents and “Active=False” for closed one. However, this doesn’t work.
When copying a Query from Service Now filter I can see that Resolved and Closed has a value of “state= 6” and “state=7”
Using this in a sysparm_query doesn’t work. sysparm_query state=6 (for instance) or if you want to use NOT !=6 (for instance for open incidents)
I had this a while ago and I found that the query is case sensitive so if you’re using “Active=True” per your description, vs “active=true”, ServiceNow will ignore that part of your query and return everything.
On a WebAPI Grid tile, through the http mode pane I’m adding table/incident to my base URL, then under the headers & data pane I’m adding a couple of entries to data for;
I grabbed this one from SQUP support a while back, asset details, created against the Windows Computer class. table/cmdb_ci_server / sysparm_queryname={{displayName}} / sysparm_fieldsasset,os_version,operational_status,assigned_to,subcategory,sys_id / sysparm_display_valuetrue / sysparm_limit10 - Did require that I allowed access to that table in SNOW too.
It worked when I used the sysparm_query on the same row {{displayName}}^active=true
Previously I had divided it so I used sysparm_query active=true on a separate line.
Thanks ARMless and thanks Jelly for the Asset info