# Workitem has to be Auto approved After 3rd Reminder

**URL:** <https://developer.sailpoint.com/discuss/t/workitem-has-to-be-auto-approved-after-3rd-reminder/126131>\
**Category:** IIQ Discussion and Questions\
**Tags:** workflows, identityiq\
**Created:** [May 8, 2025, 11:14am UTC](https://developer.sailpoint.com/discuss/t/workitem-has-to-be-auto-approved-after-3rd-reminder/126131 "2025-05-08T11:14:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harishabn](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@harishabn](https://developer.sailpoint.com/discuss/u/harishabn)\
**Post date:** [May 8, 2025, 11:14am UTC](https://developer.sailpoint.com/discuss/t/workitem-has-to-be-auto-approved-after-3rd-reminder/126131/1 "2025-05-08T11:14:28Z")

</div>

## Which IIQ version are you inquiring about?

8.4P2

## Please share any images or screenshots, if relevant.

_[Please insert images here, otherwise delete this section]_

## Please share any other relevant files that may be required (for example, logs).

_[Please insert files here, otherwise delete this section]_

## Share all details about your problem, including any error messages you may have received.

Team,

We have a requirement where we need to auto approve the remove request workitems on 10th day (We are also sending 3 reminder mails to the owners without any escalation process.), if the owner doesn’t take any action on it.

current process, the workitems are getting expired on 10th day. Any suggestions how can we achieve this case?

---

<div class="post-metadata">

**Author:** ![ajmerasunny1](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@ajmerasunny1](https://developer.sailpoint.com/discuss/u/ajmerasunny1)\
**Post date:** [May 8, 2025, 7:29pm UTC](https://developer.sailpoint.com/discuss/t/workitem-has-to-be-auto-approved-after-3rd-reminder/126131/2 "2025-05-08T19:29:11Z")

</div>

You will have to approve the approvalitems using api through interceptor code.

---

<div class="post-metadata">

**Author:** ![angelborrego](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/angelborrego/32/21987_2.png) [@angelborrego](https://developer.sailpoint.com/discuss/u/angelborrego)\
**Post date:** [May 10, 2025, 8:34am UTC](https://developer.sailpoint.com/discuss/t/workitem-has-to-be-auto-approved-after-3rd-reminder/126131/3 "2025-05-10T08:34:55Z")

</div>

Hi @harishabn ,

You can create a **Scheduled Rule** that runs daily and performs the following:

- Queries all pending **Remove access approval work items**.
- Checks if they’ve been **open for 10 days** (based on `created` timestamp).
- Programmatically **executes approval** (`WorkItem.setOutcome("Approve")`) and routes completion.

#### 📄 Sample Logic (Rule Skeleton)

```auto
import sailpoint.object.Filter;
import sailpoint.object.WorkItem;
import sailpoint.api.Workflower;
import java.util.Date;
import java.util.List;
import java.util.Calendar;

Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_YEAR, -10);
Date cutoff = cal.getTime();

// Filter all pending work items older than 10 days
Filter filter = Filter.and(
    Filter.eq("state", "Pending"),
    Filter.le("created", cutoff)
);

List workItems = context.getObjects(WorkItem.class, filter);

Workflower workflower = new Workflower(context);

for (WorkItem item : workItems) {
    if ("Remove".equalsIgnoreCase(item.getType())) {
        log.info("Auto-approving stale remove request: " + item.getName());
        item.setOutcome("Approve");
        workflower.completeWorkItem(item);
    }
}

```

> 🔒 **Make sure you add filtering to only process the work items you care about** , like LCM Remove Approval, and avoid escalation or exception queues if configured.

Hope this helps! 🚀 Let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 9, 2025, 8:35am UTC](https://developer.sailpoint.com/discuss/t/workitem-has-to-be-auto-approved-after-3rd-reminder/126131/4 "2025-07-09T08:35:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
