"RELATIVEEE@dayofweek@ahead@30" is not sending notification 30 days prior to the expiration date. Help pls.

Rajini2
Mega Sage

I am trying to generate an expiration notification from my scheduled job. Notification should go 30 days prior to the expiration date, which is catalog variable.

The first query is what I am trying and failing variables.908016f5db9c3340a1d116494896199fRELATIVEEE@dayofweek@ahead@30

var gr = new GlideRecord("sc_task");	
// this does not work.
gr.addEncodedQuery('request_item.cat_item=3ae70705db98bf00a1d11649489619ed^state=3^assignment_group=eaf43fe9db603300a1d11649489619d7^variables.8410deb5db9c3340a1d116494896194b=Approve^variables.908016f5db9c3340a1d116494896199fRELATIVEEE@dayofweek@ahead@30^sys_created_onONLast 3 months@javascript:gs.beginningOfLast3Months()@javascript:gs.endOfLast3Months()');

Any help on this is highly appreciated.

Thanks.

1 ACCEPTED SOLUTION

Mahendra RC
Mega Sage

Hello Rajini,

Could you please check with below script once:

var expiryDateGDT = new GlideDateTime();
expiryDateGDT.addDays(30);
var expiryDate = expiryDateGDT.getDate();

var query = "request_item.cat_item=3ae70705db98bf00a1d11649489619ed^assignment_group=eaf43fe9db603300a1d11649489619d7^state=3^variables.8410deb5db9c3340a1d116494896194b=Approve^variables.908016f5db9c3340a1d116494896199fON" + expiryDate +"@javascript:gs.dateGenerate('" + expiryDate + "','start')@javascript:gs.dateGenerate('" + expiryDate + "','end')^sys_created_onONLast 3 months@javascript:gs.beginningOfLast3Months()@javascript:gs.endOfLast3Months()";

var gr = new GlideRecord("sc_task");	
gr.addEncodedQuery(query);

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

View solution in original post

5 REPLIES 5

RELATIVEEE@dayofweek@ahead@30 is not working. I need this.