How to trigger a notification using gs.eventQueueScheduled based on a RITM state change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 06:59 PM
It is required that when a rhythm is changed to the “waiting” state and 5 business days pass and the status is not updated, the system automatically changes the rhythm to the closed or completed state.
1.
// Business Rule: Trigger Auto-Close on "On Hold" (-5) after 10 minutes
(function executeRule(current, previous /*null when async*/) {
if (current.state == '-5' && previous.state != '-5') {
var tenMinutesLater = new GlideDateTime();
tenMinutesLater.addseconds(10);
// Programar el evento que cerrará automáticamente el requerimiento
gs.eventQueueScheduled('close_on_hold_request', current, '', '', tenMinutesLater);
}
})(current, previous);
2. create event
3 create script action
I don't know what I'm doing wrong but it doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 07:27 PM
It's 5 days but I'm doing it with 10 seconds to do the test.
and the business rule is executed after the status changes to "on hold"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 07:33 PM
It is important to say that it does execute the event and what is failing is the action script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 09:35 PM
Hi @Prueba, I tried your problem in my PDI, please make changes in Business Rule
Add event like below line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 06:43 AM
Hello @Sarthak I made the change in the business rule but it does not make the change and "gs.eventQueueScheduled" must be used so that it is scheduled and executed 10 seconds later