How to create an event in run script?

SNnewbie2
Tera Expert

How do I create an event using an script in run script? I want to be able to create an event to create a notification for each person I want to send it to.

35 REPLIES 35

Hi Claudia Cruz,



Good Day



Please   add the logs in your code to check   whether you are receiving the email id of the users of the specific group.



I have made some changes in your script



var groupID = current.impacted_ci_first.support_group.toString();


var userList = [];  


var mem = new GlideRecord("sys_user_grmember");  


//mem.addQuery('group', groupID);/*can you please check whether this query is working or not*/


mem.addQuery('group.u_group_id',groupID);/*add the query in this way*/


mem.query();  


while (mem.next()) {  


//userList.push(mem.user.email.toString()); /*can you please confirm whether it is working or not*/


var result = test.user.email;/*It gives the email id of the users in the group*/


userList.push(result);/*it returns the email of the user in comma separated values*/


}  



Hope it will helps you!



Thanks,


Priyanka R