- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 07:35 PM
Hi
I want to sent all incidents assigned to a user in last 30 days ,i cant see assigned to date field
on incident so that i can filter the date can you please suggest how to sent this information
we were provided by the userid by the requester and in response need to send the incidents assigned to him in this month
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 01:28 AM
Hi
along with ID number, it is not possible to get short description and state of incident. In the end of endpoint URL, i have done the dot walk to get incident number from ID, same way you can get short description by giving like this id.short_description but that will not give response along with number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 09:26 PM
Hi,
for that you will have to query the sys_history_line table and check the history of incident
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 09:33 PM
Hi
We don't have any specified field in incident , which will track the assigned dates. In fact you can use metric_instance table where we have metrics defined for Incident table assigned_to field, which will basically capture the duration of assigned_to field for a particular user.
You can use below Table API to get the list of incidents which were assigned_to a particular user for last 30 days.
https://YOURINSTANCENAME.service-now.com/api/now/table/metric_instance?sysparm_query=table%3Dincident%5Efield%3Dassigned_to%5Esys_created_onRELATIVELT@dayofweek@ahead@30%5Evalue%3DBushra%20Akhtar&sysparm_fields=id.number
Here is the output , how I have achieved
1.From the instance, you need to first get the proper filter which records you want to send from metric_instance table.
Below I'm getting list of incidents assigned to Bushra Akhtar for last 30 days
Now you need to give the end point URL and user credentials in reqbin.com, which is open application to test the API's.
You can see the output on right side response
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
Regards,
Harika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 09:34 PM
for assigned date you can refer start field in metrics table, for end date you can refer end field value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 11:52 PM
Hi Harika,
Thanks for the solution i tried its returning the id number ,
i need to get the short description and state of the incident in the response as well is this achievable ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 01:28 AM
Hi
along with ID number, it is not possible to get short description and state of incident. In the end of endpoint URL, i have done the dot walk to get incident number from ID, same way you can get short description by giving like this id.short_description but that will not give response along with number.