VeerenderB
(Veerender B)
September 17, 2024, 3:34pm
1
Hi Sailers,
I would like to add date in certification reminder email template. That Date should be 3 days before the expiration. I tried below code but not working. Any inputs would be appreciated.
Case 1:
#set ($dummyDate=$spTools.formatDate($certification.expiration,“MM/dd/yyyy”))
#if ($dummyDate)
#set ($dummyUtil=$spTools.class.forName(“sailpoint.tools.Util”).newInstance())
#if ($dummyUtil)
#set ($dummydueDate=$dummyUtil.incrementDateByDays($dummyDate,-3))
#end
#end
Case 2:
#set ($dummyUtil=$spTools.class.forName(“sailpoint.tools.Util”).newInstance())
#if ($dummyUtil)
#set ($dummydueDate=$dummyUtil.incrementDateByDays($certification.expiration,-3))
#end
Using $dummydueDate in the email text.
Regards,
Veerender.
sa8173
(sunny ajmera)
September 17, 2024, 5:13pm
2
how about using something like this
$spTools.formatDate($spTools.class.forName(“sailpoint.tools.Util”).newInstance().incrementDateByDays($certification.expiration,-3),“MM/dd/yyyy”)
VeerenderB
(Veerender B)
September 18, 2024, 4:16pm
3
Thanks for the response @ajmerasunny
Working in the Body. But in Subject it is coming as Empty.
VeerenderB
(Veerender B)
September 23, 2024, 4:04am
4
Due to subject char limitation, I have tried execute only date.
Case 1:
<Subject>$spTools.formatDate($spTools.class.forName(“sailpoint.tools.Util”).newInstance().incrementDateByDays($certification.expiration,-2),“MM/dd/yyyy”)</Subject>
Response is Empty
and
Case2:
<Subject>#set ($ruleArgs={ “expirationDate”:$certification.name})#set ($ruleObj=$spctx.getObjectByName($spTools.class.forName(“sailpoint.object.Rule”),“Certification_Due_Date”))#set ($dueDateByRule=$spctx.runRule($ruleObj,$ruleArgs))$dueDateByRule</Subject>
Response is $dueDateByRule
The above one i am executing the rule. In rule i am calculating the date and same code working body as well.
Case3:
<Subject>#set ($ruleArgs={ “expirationDate”:$certification.name})#set ($ruleObj=$spctx.getObjectByName($spTools.class.forName(“sailpoint.object.Rule”),“Certification_Due_Date”))$spctx.runRule($ruleObj,$ruleArgs)</Subject>
Response is $spctx.runRule($ruleObj,$ruleArgs)
VeerenderB
(Veerender B)
September 24, 2024, 10:33am
5
Above scenarios not worked for me. I have customized the certification tags and used that in the Subject line. That worked for me.