Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Generate Email in Outbox

Suyash Joshi
Tera Contributor

Hello Everyone,

I need a requirement :-

Generate an approval for any table. If the approval state remains 'requested' for 3 days without being approved, send a notification reminder. Additionally, if the approval is still in the 'requested' state after 5 days, check it again, and if it persists, send a remainder notification.

My workflow in which I tried two different script for getting notification

1.By creating a event registry -

gs.eventQueue('demo.notified', current, current.number, gs.getUserName());
2.var currentDate = new GlideDateTime();
currentDate.setDisplayValue(currentDate.getDisplayValue().toString());
var gh = new GlideDateTime();
gh.add(67000);
var gr = new GlideRecord('sc_req_item');
gr.query();
while (gr.next()) {
  gs.eventQueue('demo.notified', current, current.number, gs.getUserName());
}
(It is example for getting notification in few seconds)
but still I'm unable to get the notification message in outbox 
Can anyone solve my issue regarding notification it would really be a great help on urgent basis.
Thanks and Regards,
Suyash
5 REPLIES 5

@Suyash Joshi  .

we design the same in Workflow as well , the above logic fetches records which are not Approved since 3days ,  can you please show the workflow to check where you have added this new logic 

Regards,

Shyamkumar

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar