Send Push Notification To Supervisor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 02:26 AM
I have a use case, which is to send a push notification to the supervisor when a work order is created.
Here are my business rules:
(function executeRule(current, previous /*null when async*/ ) {
var mtcSupervisorSkillId = 'f6d604291b14c5506846db9fe54bcb18';
// Get coverage groups for this task that have the maintenance supervisor skill
var recipientGroups = global.getFsmCoverageGroupsWithSkills(current, [mtcSupervisorSkillId]);
// Log an error if there's no group coverage for the WO task's location
if (!recipientGroups) global.NiceError.raise(
'Tried to send coverage-based notification for ' +
current.number +
', but there there were no groups with coverage for the task location'
);
// Trigger the notification event
recipientGroups.forEach(function(recipientGroup) {
gs.eventQueue('fsm.work_order.created', current, recipientGroup);
});
})(current, previous);
These are the events that trigger the notification:
These are the notification settings:
Tab who Will Receive
Tab Contain
Goal is this and Mobile
0 REPLIES 0