Triggering an Event from Scheduled Job that cancels approvals after 4 weeks.

EricG
Kilo Sage

Hello Guru's:

 

I've always struggled getting Events to trigger Email Notifications.  I'm hoping someone can advise why this isn't sending the email.

 

Use Case:

I need to send out a Notification to the Requestor when their catalog item is cancelled due to inactivity on the Approval Record. 

 

I have a Scheduled Job that combs the sysapproval_approver record for any "Reuested" state that is older than 4 weeks old.  (scheduled Job)

The code for the "Raise Event" is gs.eventQueue('sc_req_item.approval.cancelled', current, par1, par2);

The event raised is populating correctly. I get the User sys_id and Name in correct place.

EricG_0-1695820020930.png

 

I'm not able to to get the Notification to sent.

I've tried several ways to get this.

1. Used the event.  Nada

2. Set the notification to Insert/Update condition approval state is No Required and Approving state is Closed incomplete.

 

What might the issue be?

 

1 ACCEPTED SOLUTION

OlaN
Giga Sage
Giga Sage

Hi,

There is also a No-code way to solve this, by creating a Flow that does all the steps.

Providing a simple example below, you can use either the Send Notification (step 4 in my example), or the Send Email action (step 5 in my example).

Let me know if you want to dive into this, or require more help.

flow-cancel-old-approvals-and-send-notification.png

View solution in original post

7 REPLIES 7

OlaN
Giga Sage
Giga Sage

Hi,

There is also a No-code way to solve this, by creating a Flow that does all the steps.

Providing a simple example below, you can use either the Send Notification (step 4 in my example), or the Send Email action (step 5 in my example).

Let me know if you want to dive into this, or require more help.

flow-cancel-old-approvals-and-send-notification.png

I like this idea and still new-ish in creating flows.

Figured out how to get the approvals, Set them to Cancelled, then find the RITM update that accordingly.

 

Issue:

1. updating the Stage on RITM.  It sets the ticket to closed complete, instead of request cancelled.

EricG_0-1695834423107.png

2.  Getting the "Approve #" notification and not my Request has been cancelled.

EricG_1-1695834514317.png vs 

EricG_2-1695834814361.png

 

Here is my flow:

EricG_3-1695834897688.png

I have no other notification on sysapproval_approver table that is set to Trigger

 

OK.  As I'm still a newbee to FLOW, I followed the Second activity.  Send Email.

That's working as i wanted it.

Thanks for the help.