- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2022 04:03 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2022 09:53 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2022 03:10 PM
RELATIVEEE@dayofweek@ahead@30 is not working. I need this.