Which IIQ version are you inquiring about?
Version 8.3
Share all details related to your problem, including any error messages you may have received.
Hi,
we have a requirement to get newly created entitlements display name and send that list to a specific workroup via mail.
As initial step , I created custom rule to get newly created entitlement display name in which I created a method to send that entitlement list to a specific workgroup.
My custom rule:
List entNm = new ArrayList();
String entlist=“”;
entNm.append("Entitlement Name : ");
ManagedAttribute ma = new ManagedAttribute();
QueryOptions qo = new QueryOptions();
Date last1DayDate = new Date();
last1DayDate= DateUtils.addDays(last1DayDate, -1);
qo.addFilter(Filter.gt(“created”,last1DayDate));// Filter to Get entitlements created in last 1 day
log.error (“qo list is :”+qo);
IncrementalObjectIterator<ManagedAttribute> managedAttrsIterator = new IncrementalObjectIterator<ManagedAttribute>(context, ManagedAttribute.class, qo);
while (managedAttrsIterator.hasNext()) {
ManagedAttribute managedAttr = (ManagedAttribute) managedAttrsIterator.next();
entNm.add(managedAttr.getDisplayName());
}
log.error (“getDisplayName:”+entNm);
entlist = entNm.toString();
return entlist;
sendNewAccountEmail(entlist);
public void sendNewAccountEmail(String entlist){
EmailTemplate template = context.getObjectByName(EmailTemplate.class, “New Entitlement Notification”);
EmailOptions options = new EmailOptions();
String workgroupName = “Certification Administrator”;
Identity workgroup = context.getObjectByName(context, workgroupName);
List emails = sailpoint.api.ObjectUtil.getEffectiveEmails(context, workgroup);
Identity managerIdentity = identity.getManager();
options.setTo(emails);
Map args = new HashMap();
args.put(“entlist”, entlist);
options.setVariables(args);
context.sendEmailNotification(template,options);
}
Secondly , I created dummy email template to refer the entitlements list
<?xml version='1.0' encoding='UTF-8'?> <html>
<body>
Please find below the new entitlements
<p>
New Entitlement added: $entlist
<br/>
***Please do not reply to this email because this is an outgoing mailbox only. Thanks.***
****************************************************************************************************
</p>
<br/>
</body>
</html>
New Entitlement Notification
New Entitlement Notification
Thirdly, I ran a task definition where I referred this custom rule.
But for some reason email is not getting trigerred and I dont get any errors.
Can someone suggest what I am missing in the code. Any suggestions will be helpfull.
Thanks!