Work Item Reminders Are Not Triggering

Which IIQ version are you inquiring about?

8.4P1

  • The workitem is failing to trigger the initial notification.
  • After manually triggering the initial notification, no reminders are being sent.

Below is the code that I’m using to generate workItem.

        boolean revokeExist = false;
		Identity requester = context.getObjectByName(Identity.class, "requesterName");
		ApprovalSet approvalSet = new ApprovalSet();
		Identity ownerIdentity = context.getObjectByName(Identity.class, "itemOwnerName");

		ApprovalItem approvalItem = new ApprovalItem();
		approvalItem.setApplication("App");
		approvalItem.setRequesterComments("comment");
		approvalItem.setOperation("Revoke");
		approvalItem.setApprover("itemOwnerName");

		approvalSet.add(approvalItem);


		if (revokeExist) {
			String wiDescription = "Revoke - Change Base/Flex Role for " + ownerIdentity.getDisplayName();
			WorkItem workItem = new WorkItem();
			workItem.setType(WorkItem.Type.ManualAction);
			workItem.setApprovalSet(approvalSet);

			workItem.setDescription(wiDescription);
			workItem.setLevel(WorkItem.Level.Normal);
			workItem.setState(WorkItem.State.Pending);
			workItem.setOwner(ownerIdentity);
			workItem.setRequester(requester);
			workItem.setTargetClass(Certification.class.getName());
			workItem.setRenderer("lcmManualActionsRenderer.xhtml");
			workItem.setHandler(Workflower.class);

			Sequencer sequencer = new Sequencer();
			workItem.setName(sequencer.generateId(context, workItem));

			Calendar calendar = Calendar.getInstance();
			calendar.add(Calendar.MINUTE, 10);

			NotificationConfig notificationConfig = new NotificationConfig();
			notificationConfig.setEnabled(true);
			notificationConfig.setStartDate(calendar.getTime());

			IConfig reminderConfig = new ReminderConfig();
			reminderConfig.setEnabled(true);
			reminderConfig.setMillis(86400000);
			reminderConfig.setFrequency(86400000);
			String emailTemplateName = "Reminder Template";
			reminderConfig.setEmailTemplateName(emailTemplateName);

			ConfigBase configBase = new ReminderConfig();
			configBase.isSame(reminderConfig);

			List iconfigList = new ArrayList();
			iconfigList.add(configBase);
			iconfigList.add(reminderConfig);

			notificationConfig.setConfigs(iconfigList);
			workItem.setNotificationConfig(notificationConfig);

			calendar.add(Calendar.DATE, 30);
			workItem.setExpiration(calendar.getTime());

			context.saveObject(workItem);
			context.commitTransaction();

			Map emailInputs = new HashMap();
			emailInputs.put("workItem", workItem);
			emailInputs.put("workItemName", "workItemName");

			EmailTemplate template = context.getObjectByName(EmailTemplate.class, "templateName");
			EmailOptions mailOpts = new EmailOptions("effectiveEmails", emailInputs);
			context.sendEmailNotification(template, mailOpts);
		}

Did you run Check Expired Workitems task?

Hi @sathieshg,

If after running the Task “Check Expired WorkItem” if it is not triggering reminder then please share sample workitem being generated.

Thanks

Yes, we run the “Check expired work item” every day, and it was run to test the email.
Nothing happened.

Here is the sample work item.

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE WorkItem PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<WorkItem created="1723130700858" expiration="1725723300780" handler="sailpoint.api.Workflower" id="id" level="Normal" modified="1723136014914" name="0000306768" renderer="lcmManualActionsRenderer.xhtml" state="Pending" targetClass="sailpoint.object.Certification" type="ManualAction">
  <Attributes>
    <Map>
      <entry key="approvalSet">
        <value>
          <ApprovalSet>
            <ApprovalItem application="App" approver="Sathiesh" id="id" operation="Revoke" requesterComments="As part of review - you revoked the entitlement from Security Role &quot;IIQ Test role&quot;. Please submit &quot;Role Content Change&quot; reqeust"/>
          </ApprovalSet>
        </value>
      </entry>
    </Map>
  </Attributes>
  <Description>Revoke - Change Base/Flex Role in Security Service</Description>
  <NotifConfig>
    <NotificationConfig enabled="true" reminderFrequency="86400000" remindersEnabled="true">
      <Configs>
        <ReminderConfig emailTemplateName="Revoke Reminder" enabled="true" frequency="86400000" millis="86400000"/>
      </Configs>
    </NotificationConfig>
  </NotifConfig>
  <Owner>
    <Reference class="sailpoint.object.Identity" id="id" name="Sathiesh"/>
  </Owner>
  <Requester>
    <Reference class="sailpoint.object.Identity" id="id" name="Sathiesh"/>
  </Requester>
</WorkItem>

Hi @sathieshg,

Can you try setting below variable as shown below in sample snippet and test. Let me know if you still face issue. Screenshot is attached for your reference.

Attributes<String,Object> attributes=new Attributes<String, Object>();
		attributes.put("workItemHoursBetweenReminders","10");
		attributes.put("workItemMaxReminders","2");
		attributes.put("workItemEscalationFrequency","3");
		attributes.put("workItemHoursTillEscalation","10");
		attributes.put("workItemEscalationTemplate","ABC Template");
		
		workItem.setAttributes(attributes);

Thanks

Apologies for the delay in testing. Unfortunately, this change did not resolve the issue.

Does anyone have further suggestions or ideas to make this work? I’d appreciate any additional input.

Hi Sathiesh,
Currently I am also working on the same issue, can you please let me know if you are able to fix this. When I run the “Check Expired WorkItem” task, the workitem is getting scanned, but the reminders were not sent.
Regards,
Abhilash

Hi Sathiesh,
I am also working on the same use case. I had modified your code and fixed the issue now. Now the emails are triggered whenever check expired work item task runs. Make sure you have an proper email for the user to whom the work item is assigned. Please check the below code

   if(manualItem != null){
				Calendar calendar = Calendar.getInstance();
			calendar.add(Calendar.MINUTE, 10);
			NotificationConfig notificationConfig = new NotificationConfig();
			notificationConfig.setEnabled(true);
			notificationConfig.setStartDate(calendar.getTime());
			
			IConfig reminderConfig = new ReminderConfig();
			reminderConfig.setEnabled(true);
			reminderConfig.setMillis(259200000);
			reminderConfig.setFrequency(259200000);

			String emailTemplateName = "Custom Work Item Reminder";
			reminderConfig.setEmailTemplateName(emailTemplateName);
			
			EscalationConfig escConfig = new EscalationConfig();
						escConfig.setEscalationRuleName("Escalation IIQ Support");
						escConfig.setMaxReminders(10);
						escConfig.setMillis(259200000);
						escConfig.setFrequency(259200000);
						escConfig.setEmailTemplateName(emailTemplateName);
						escConfig.setEnabled(true);


			List iconfigList = new ArrayList();
			//iconfigList.add(configBase);
			iconfigList.add(reminderConfig);
			iconfigList.add(escConfig);

			notificationConfig.setConfigs(iconfigList);
			manualItem.setNotificationConfig(notificationConfig);
			java.util.Date d = new Date();
			manualItem.setWakeUpDate(d);
			commit = true;
			
          }
    if(commit) {
			context.saveObject(manualItem);
			context.commitTransaction();
		}

Setting the wakeup set and escalations fixed the issue.
Regards,
Abhilash