- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 01:51 AM
Hi everyone,
I'm trying to filter SLAs from the task_sla table based on the closure or cancellation dates of their associated incidents.
Specifically, I want to retrieve SLAs for incidents that were closed or canceled within specific timeframes, such as:
- Last month
- Last 3 months
- This month
- Last 6 months
For example, I'd like to see all SLAs for incidents that were closed or canceled within the last month.
Could someone please advise on how to achieve this filtering?
This is my filter so far, but this is incorrect i thinks its filter only on closed at date?
Thanks for your help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 02:26 AM
Hi @JohnDF
Absolutely we can dot-walk to child task-related tables. There you go.
When an Incident or Requested Item get cancelled, the Closed [closed_at] field will be populated, you can base on it for the date time filter.
I'm looking to get the date when any task type is set to inactive, not just incidents. I'll need to expand this to other task types like ritm later on.
=> No problem at all. It's just if we leverage a database view for specific child tables, it could potentially benefit performance later on by reducing the huge amount of data within the task_sla table.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 02:02 AM
Hi @JohnDF
There is a specific database view for Incident SLA [incident_sla] that you can leverage for your scenario.
To see all SLAs for incidents that were closed or canceled within the last month, you can use the following URL as a sample:
https://<instance_name>.service-now.com/incident_sla_list.do?sysparm_query=inc_incident_stateIN7,8^inc_closed_atONLast%20month@javascript:gs.beginningOfLastMonth()@javascript:gs.endOfLastMonth()
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 02:09 AM - edited ‎07-30-2024 02:10 AM
Hi @Tai Vu thanks for your reply.
While the example you provided was helpful, I need to apply this concept to the task_sla table, not just the incident table. I'm looking to get the date when any task type is set to inactive, not just incidents. I'll need to expand this to other task types like ritm later on.
Is there a way to "dot walk" from the task_sla table to the related task (like an incident or a RITM) and then access the fields to determine when the task was set to inactive/closed?
Thanks again for your assistance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 02:26 AM
Hi @JohnDF
Absolutely we can dot-walk to child task-related tables. There you go.
When an Incident or Requested Item get cancelled, the Closed [closed_at] field will be populated, you can base on it for the date time filter.
I'm looking to get the date when any task type is set to inactive, not just incidents. I'll need to expand this to other task types like ritm later on.
=> No problem at all. It's just if we leverage a database view for specific child tables, it could potentially benefit performance later on by reducing the huge amount of data within the task_sla table.
Cheers,
Tai Vu