The CreatorCon Call for Content is officially open! Get started here.

Using ^JOIN in encoded query

Mathias Johans1
Mega Expert

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?

1 ACCEPTED SOLUTION

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!

View solution in original post

10 REPLIES 10

imran rasheed
Tera Contributor

@Mathias Johans1 : I am facing the same issue with querying the JOIN. Instead of your stage cancelled, I am trying to show only resolution sla's. The current setup shows both response and resolution.

Tried the below query, but it didn't work.

       var SLA_AT_RISK_TODAY_QUERY = '^JOINsc_task.sys_id=task_sla.task!planned_end_timeONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()'+ '^JOINsc_task.sys_id=task_sla.task!task_sla.sla.target=resolution';