How to dot-walk from 'task_sla' table to 'incident' table?

Mazin AliKarar
Mega Expert

Hi all,

I am configuring a notification on 'task_sla' table to send a notification when an incident breaches while the requester is a specific user (for example CEO).

The notification works fine except that I got stuck where I could not jump from 'task_sla' table to 'incident' table to specify the Requester (caller_id) as CEO.

 

This is a screenshot of the notification:

find_real_file.png

 

This is the condition where I need to specify the Requester(caller_id) as CEO:

find_real_file.png

 

The 'incident' table has 2 fields that I want to check for (caller_idu_on_behalf_of). if the CEO is in either of these two fields the notification should be triggered in case of a breach.

 

Now the question is how can I jump to 'incident' table to check for  caller_id & u_on_behalf_of fields in the notification?

 

Best regards, 

Mazin 

1 ACCEPTED SOLUTION

i am not sure if you can able to fetch the caller id in condition builder but there is another way to build condition in notification by using advance condition, there you need to write the script that i had mentioned above.

The field should return 'true' or 'false'

sample script

eg:

var gr = new GlideRecord("incident");
gr.addQuery("number", current.task.number);

gr.addQuery("caller_id","<pass the sys id of that caller>");
gr.query();
if (gr.next())
{
answer false;
}

else

{

answer true;

}

 

 

 

View solution in original post

10 REPLIES 10

Hi Harshvardhan,

Thank you for the very helpful tips 😄

 

I understand that I can create a Mail Script and call it in the notification content to get the caller_id.

But, I still need to check for the caller_id in the notification condition in the "When To Send", because I want the notification to go if only the Requester is the CEO. 

Will the Mail script work here? I doubt

 

find_real_file.png 

 

I think you can easily compare the Title of the caller id in the condition builder.

In the condition builder click Show Related List and then expand Task and then expand Caller ID and select Title.

Compare the Title if CEO or Chief Executive Officer.


Please mark this response as correct or helpful if it assisted you with your question.

i am not sure if you can able to fetch the caller id in condition builder but there is another way to build condition in notification by using advance condition, there you need to write the script that i had mentioned above.

The field should return 'true' or 'false'

sample script

eg:

var gr = new GlideRecord("incident");
gr.addQuery("number", current.task.number);

gr.addQuery("caller_id","<pass the sys id of that caller>");
gr.query();
if (gr.next())
{
answer false;
}

else

{

answer true;

}

 

 

 

Thanks a lot 😄

I have got it working by writing a server-side script in the advanced condition script editor. 

But I wouldn't suggest hardcoding. Because the CEO may change tomorrow.

And I am pretty sure, we can do dot-walking in condition and it will work.


Please mark this response as correct or helpful if it assisted you with your question.