Event Queue using Gliderecord as recipients for notifications. Thank you!

Max Lin
Tera Contributor

Dear all experts.

I'm trying to make a SCTASK notify Assessor of the assigned group. If i understand correctly from all community posts, i need to create a business rule which will insert a event that triggers a table list of recipient referrence to Groups. 

Assessor table (Reference to Groups)
find_real_file.png

However, how do i use a gliderecord and add multiple users into Parm1 of events (pull out this Assessor table and reference to the assigned group)? 

thanks for the help guys.. i'm really pulling out my hair on this issue. 

 

Thanks! 

 

1 ACCEPTED SOLUTION

Muralidharan BS
Mega Sage
Mega Sage

Hi Max,

Just glide the assessor table and create a list of users and then trigger the event like this. 

ensure the right table name, sysid, eventname etc below. 

 

var userList = [];
var grSysUserGrmember = new GlideRecord('assessor table name');
grSysUserGrmember.addEncodedQuery("group=477a05d153013010b846ddeeff7b1225"); //sysid of the group
grSysUserGrmember.query();
while (grSysUserGrmember.next()) {
    userList.push(grSysUserGrmember.sys_id.toString());
}

gs.eventQueue("event.name", current, userList, parm2);

 

Thanks

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Sorry it's not clear.

Can you explain in detail?

what BR or script did you start?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Muralidharan BS
Mega Sage
Mega Sage

Hi Max,

Just glide the assessor table and create a list of users and then trigger the event like this. 

ensure the right table name, sysid, eventname etc below. 

 

var userList = [];
var grSysUserGrmember = new GlideRecord('assessor table name');
grSysUserGrmember.addEncodedQuery("group=477a05d153013010b846ddeeff7b1225"); //sysid of the group
grSysUserGrmember.query();
while (grSysUserGrmember.next()) {
    userList.push(grSysUserGrmember.sys_id.toString());
}

gs.eventQueue("event.name", current, userList, parm2);

 

Thanks