# Sunset of Entitlements through code

**URL:** <https://developer.sailpoint.com/discuss/t/sunset-of-entitlements-through-code/90403>\
**Category:** IIQ Discussion and Questions\
**Tags:** workflows, identityiq, provisioning, entitlements\
**Created:** [November 21, 2024, 8:33am UTC](https://developer.sailpoint.com/discuss/t/sunset-of-entitlements-through-code/90403 "2024-11-21T08:33:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishavghoshacc](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@rishavghoshacc](https://developer.sailpoint.com/discuss/u/rishavghoshacc)\
**Post date:** [November 21, 2024, 8:33am UTC](https://developer.sailpoint.com/discuss/t/sunset-of-entitlements-through-code/90403/1 "2024-11-21T08:33:35Z")

</div>

Hi all,

Is it possible to set a sunset date for any entitlement request through code?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![abartkowski](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/abartkowski/32/23007_2.png) [@abartkowski](https://developer.sailpoint.com/discuss/u/abartkowski)\
**Post date:** [November 21, 2024, 1:53pm UTC](https://developer.sailpoint.com/discuss/t/sunset-of-entitlements-through-code/90403/2 "2024-11-21T13:53:03Z")

</div>

You can create a Business Role that will include an IT Role pointing to this entitlement. When requesting access to the Business Role, you have the option to set a date after which the selected user may lose the assigned Business Role.

Go to Quicklink → Manage User Access → Select Identity → Select Business Role → In the 3rd step click on calendar in the right cornenr end set dates like in the image below:

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/e/5/e5e77d8cfeeb1bbcec744f065dfa51d4620a3ac4.png)

If you want try this within source code you can use Bundle Object.

Dummy Code Example:

```auto
    Bundle bundle = new Bundle();
        bundle.setActivationDate(LocalDate.now().toDate());
        bundle.setDeactivationDate(LocalDate.now().toDate());

```

---

<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:** [January 20, 2025, 1:53pm UTC](https://developer.sailpoint.com/discuss/t/sunset-of-entitlements-through-code/90403/3 "2025-01-20T13:53:58Z")

</div>

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