Change task api filter by specific date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 12:49 AM
Hi,
I am trying to filter with an API call for all the change tasks starting with a specific date, eg. change task of last year.
https://baseurl_service-now.com/api/now/table/change_task?sysparm_query=assigned_group.name=MYGROUP&...
From service now I get all change tasks of 2024, but from the API I get also change tasks of 2018.
Could you point me to right solution, that is to get only those of 2024?
Is possible to filter for a specific date? E.g. All Change tasks created starting from 1/01/2024.
Thank you
KR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 08:04 PM - edited 02-03-2025 08:04 PM
Hello,
I can't see the full URL you are using, however, try using a query like below:
sys_created_onONLast%20year%40javascript%3Ags.beginningOfLastYear()%40javascript%3Ags.endOfLastYear()
I would recommend using the REST API Explorer to generate the url for you. If you get the encoded query that works for you and add that to the API explorer, it should sanitise it for you, such as by adding %20 where necessary.
Hope that helps.