This question has been posing a few issues recently, but a number of clients have been attempting to return a list of requests via the API by a specific value on the request, such as “group.” As with a lot of these things, it’s pretty simple but not immediately obvious if you don’t know where to look for the information.
First off, you might want to download a free API tool like Postman to get your test up and running.
The first operation we are interested in is “View All Requests,” as shown in the API documentation below:
The operation has a few controls of interest, namely ”filterby”. Once you realise this, it opens up a raft of possibilities, as you can even use your own custom filters to return a list of requests.
The key point to take away here is that it is a filtered list of requests. Once you realise this, it opens up a raft of possibilities, as you can even use your own custom filters to return a list of requests.
Now for the catch. As much as you might replace the ‘filter_by’ option with the name of your filter in ServiceDesk Plus, it never seems to work as intended. This is where you need a second operation, ‘View Request Filters’, from the API to determine the ‘View ID’ of the filter you want to apply to the returned list of requests:
Once you’ve determined the ‘View ID’, and this includes any group filters you may have set for the Technician account you’re using the API key for, you can substitute this in the ‘filterby’ control of the ‘View All Requests’ operation.
To help you out, I’ve included an example PowerShell script that searches for a custom group I’ve created in my test system of “Case Management” (for simplicity, you can easily test this script in the PowerShell ISE editor by replacing the URL, technician key, and “filterby” elements).
In the example, you’ll see the ‘View ID’ of the group ‘Case Management’ is, in fact, ‘Case Management_QUEUE”… of course!