Notify Assignment group and assigned to from a scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 01:47 AM
Hey community,
I have to send an notification related to tasks.
1. Suppose there are 10 tasks for which assignment group is there. Let's say "XYZ" group.
And out of 10 Tasks, 5 are having assigned to as empty and for assigned to is not empty.
Now I have to send an email on two conditions:
a. If assigned to is empty, send notification to "Assignment group".
b. If assigned to is not empty, I have to trigger to "assigned to".
** I have to trigger notification from a scheduled job. I mean with event.
Is there any way that I can do this on a single email notifcation and using single event?
- Labels:
-
Incident Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 04:21 AM
1. Create two events - (Assignedtoempty , Assignedtonotempty) .[ Navigate to event register and create those records]
2.In the scheduled job gliderecord the respective table and apply the query condition.Trigger event from gs.eventQueue().
3. In notification when to run condition specify the event name and in recepients check the event param1 ( Sent recepients information in param1.)
Mark correct and helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 04:23 AM
Hey community,
I did this with the help of event.
//Check all the active Tasks which are related to Parent record.
var MyTasks = new GlideRecord('table');
MyTasks.addEncodedQuery('addedmyEncodedQuery^active=true');
MyTasks .query();
while (MyTasks .next()) {
if (MyTasks .assigned_to == '') //check if it is empty or not.
{
gs.eventQueue('event.name', MyTasks , MyTasks .assignment_group);
/*sameevent
if assigned to is empty it will kick off
*/
}
else {
gs.eventQueue('event.name', MyTasks , MyTasks .assigned_to);
/*sameevent
if assigned to is not empty it will kick off and send it to assigned to user.
*/
}
}
In the "who will receive" tab I checked the "" to true.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 04:50 AM
Hi,
While calling the event check the assignment group is empty or not. If empty then pass assigned to as event parameter. else pass assignment group.
Regards,
Sumanth