REST API - Get the Input of user id and Pass the count of Assigned Tickets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2020 07:23 AM
I have a requirement where I need to get the value of the user id as input outside of ServiceNow and send this value to ServiceNow using REST API to get the count of how many tickets assigned to this user id. Please let me know if anyone has done something like this or have some inputs.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2020 02:02 PM
Hi Ankur,
The link what i have used earlier was
https://xxxxx.service-now.com/api/now/stats/sc_req_item?sysparm_query=active%3Dtrue%5Erequest.requested_forDYNAMIC90d1921e5f510100a9ad2572f2b477fe&sysparm_count=true
Here Dynamic followed by sys id relates to Dynamic is Me but the requirement here is instead of defining it to "ME" or logged in user, they want to pass the value of the Assigned To and get the count of the tickets.
Also, could you please explain, is it Aggregate API or Table API you have used in the above scenario.
Moreover the team is asking for one single API with count of assigned tickets, submitted tickets(Requested For/Caller = User name), My Approvals Tickets etc. These things are from various tables, is it possible to have it as single REST API or it has to be individuals.
The one what I have created are 4 separate links but that is not what they are looking for.