hot to dot walk from request to catalog task related field

mohamudali
Kilo Contributor

I am creating notification from the request item and wanted to filter the assignment group of the catalog task and would like to dot walk to check the assignment group of the task to determined if the notification will be sent. It there way to dot walk from request to catalog task related field?

5 REPLIES 5

arnabwa
Giga Guru

Hi,



You can achieve this easily by writing an notification email script. Glide the catalog task you want by using unique fields like custom description or any other field that is unique in every catalog task. Then get the assignment group from the task and print it in the email the email script. I mean the out put of the email script should be the assignment group of the task. Then use this email script name in the body of email notification. This way you can have the assignment group being displayed in the notification mail.
Please let me know if my understanding is correct.



Thanks,
Arnab


Inactive_Us1474
Giga Guru

Hi,


Use advance condition of the notification and below script :


var gr=new GlideRecord('sc_task');


gr.addQuery('request_item',current.sys_id);


gr.query();


if(gr.next() && gr.assignment_group.getDisplayValue() == 'Service Desk') //any value to compare


  {


  answer=true;


  }


else


  {


  answer=false;


  }



Thanks


Akhil


Hit Like/helpful/correct, if applicable.


Abhinay Erra
Giga Sage

Here is a sample script. Here current is your request item record.



var task= new GlideRecord('sc_task');


task.addQuery('request_item',current.getValue('sys_id'));


task.addQuery('assignment_group.name','<name of your assignment group goes here>');


taskquery();


if(task.hasNext()){


//do your manipulation here when the task contains the group you are looking for


}


Thank you all, guys,



If I want to send the notification only if it matches One support group department will this work?



For example, I wanted to look support group department to send notification if only matches the particular support group department.