I am working on the schedular in iiq for generating report. I want build a code to get the users who got assigned to the entitlements with the 6 hours while the refresh of this rule is done everyday.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule created="1726467520558" id="0ad8290f91ef11908191f97bb82e664a" language="beanshell" modified="1726730556286" name="BBY-idenFilter12">
<Source>
import sailpoint.object.*;
import sailpoint.object.Filter;
import java.util.Calendar;
import java.util.Date;
import java.text.SimpleDateFormat;
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Date today = new Date();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.HOUR, -4);
Date fourHourBack = cal.getTime();
// Fetch the epoch time stamp from the filtering entitlement value
String entitlementValue = "CN=BBY-U-US-SLM-Standard-Request,OU=Groups,OU=Best Buy,OU=Users and Groups,DC=naqa,DC=bestbuyqa,DC=com"; // Replace with your entitlement value
long epochTime = getEpochTimeFromEntitlementValue(entitlementValue);
Date epochDate = new Date(epochTime);
QueryOptions qo = new QueryOptions();
qo.addFilter(Filter.ge("created", fourHourBack));
qo.addFilter(Filter.eq("value", entitlementValue));
List idenEntList = context.getObjects(IdentityEntitlement.class, qo);
return idenEntList;
</Source>
</Rule>
here a sample code to make the changes of the time stamp to filter out the users and entitlement. Can anyone please help me with the filter of the application and entitlement and check the users updated to the entitlement and generate report.