To fetch incident, change Records created within a specific range of days (1 to 30)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 06:44 AM
Hi All,
dynamic way to fetch Incident & Change records from task_ci table created within a specific range of days (1 to 30), based on a user-defined days_ago query parameter through scripted Rest api.
Adding an Integer variable to the endpoint, and you can give us an Integer 1-30, and we would return tickets created over that many days. If you give us a number over 30, we'll return the last 30 days' worth of tickets.
It's throwing an error in below highlighted line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 02:23 AM - edited 01-16-2025 02:24 AM
Hello @Hiranmayee Moha
Please use the below Logic i performed the small changes in query
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 08:52 AM
Hi @Sanjay191
Sorry for late response.
Could you please explain why we are querying 32 days not 30 days (My requirement range is 1--30)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 08:56 AM
Hello @Hiranmayee Moha
You can put according to your requirement I just give you example or logic .Just update the values whatever you want like last 30 days, 7 days etc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 08:58 AM
Thanks @Sanjay191