how to trigger notification through event?

Servicenow10
Kilo Guru

 i need to send one notification which is for problem_task table and my event is on problem table so how to trigger that event.

@asifnoor  could you please help me with this

 

thanks in advance!!

1 ACCEPTED SOLUTION

Hi

since your notification is on problem table, you can write a mail script and can query the problem_task details like this.

var gr = new GlideRecord("problem_task");
gr.addQuery("problem",current.sys_id);//check field names
gr.query();
while(gr.next()) {
  template.print(gr.number.toString());
  template.print("<br>");
}

View solution in original post

4 REPLIES 4

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Even if your event is on problem table, in  the second parameter of gs.eventQueue function you can pass the object of problem task and so the notification will take fields of problem task.

gs.eventQueue('event name', Problem_Task_object, parm 1, parm 2);

-Anurag

-Anurag

asifnoor
Kilo Patron

Hi,

Write a BR on your problem task table and add your filter conditions

In your script, you can fetch the problem record using this line

var problem = current.problem.getRefRecord();

gs.eventQueue("your_event",problem,"","");

And you need to ensure that your notification is also on problem table only then the notification will fire..

Servicenow10
Kilo Guru
in my notification, i want to fetch problem task number.. how can i do that?
 

Hi

since your notification is on problem table, you can write a mail script and can query the problem_task details like this.

var gr = new GlideRecord("problem_task");
gr.addQuery("problem",current.sys_id);//check field names
gr.query();
while(gr.next()) {
  template.print(gr.number.toString());
  template.print("<br>");
}