
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 02:16 AM
Hi!
I have recently bumped in to an unusual encoded query that I need to adjust.
The goal is to query incidents where there are breached Task SLA's, where Task SLA.stage is not cancelled.
In the script include "SOWUpcomingLinkProvider_Incidents", I can find the syntax "^JOINincident.sys_id=task_sla.task!has_breached=false". This is then run on a GlideRecord Query on incident table. I suspect that I need to add the "stage!=cancelled" query, but it seems that this syntax does not work like a normal query.
i have tried "^JOINincident.sys_id=task_sla.task!has_breached=false^stage!=cancelled", but this seems to be wrong.
Can someone help me clarify this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 07:06 AM
Thanks for your help!
I was looking some more at the code and realized that I should add the full ^JOIN syntax once more to get the desired outcome; eg: '^JOINincident.sys_id=task_sla.task!has_breached=true' + '^JOINincident.sys_id=task_sla.task!stage!=cancelled';
You did point me in the right direction, so it was very helpful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 02:38 AM - edited ‎10-19-2022 02:39 AM
Hi Mathias,
It is a Join Query, so you need to add the "!" syntax to add an additional condition.
So it could look something like this:
"^JOINincident.sys_id=task_sla.task!has_breached=false!stage!=cancelled"
Best regards,
Sebastian Laursen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 05:14 AM
Hi,
Unfortunately, that doesn't work either.. even if I try another condition, eg "^JOINincident.sys_id=task_sla.task!has_breached=false!stage=completed", I still get Cancelled Task SLAs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 05:18 AM - edited ‎10-19-2022 05:18 AM
And it is not because there already are Task SLAs exisiting for the incident? So if the incident has 3 SLAs, and one of them is cancelled, then it will still return the incident since it is a join, and are looking for any condition that matches in task_sla table with that task(incident).. Just wondering 🙂
Best regards,
Sebastian Laursen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2022 05:20 AM
I wish it was that simple.. The Incident that keeps showing up has 2 Task SLA's, both are cancelled..