autorun6464
(Anmol Timilsina)
January 23, 2025, 9:07pm
1
So i been trying to set accountgroup owner to default if the group has no owner but the problem is some of them are setting to default but some are not .
import org.apache.log4j.Logger;
import java.util.Date;
import sailpoint.object.*;
import java.util.Calendar;
Identity id = null;
//log.error("Obj :: "+obj.toXml());
//log.error("groupApplication :: "+groupApplication.toXml());
id = context.getObjectByName(Identity.class, "Salesforce Service_1E Default Owner");
Identity currentOwner = accountGroup.getOwner();
if(currentOwner == null || currentOwner.isDisabled()){
accountGroup.setOwner(id);
}
return accountGroup;
Hi, after setting the owner you should use:
context.saveObject(accountGroup);
context.commitTransaction();
So that the changes are saved.
iamksatish
(Satish Kurasala)
January 28, 2025, 4:17pm
4
@autorun6464
Is this the refresh rule code or a standalone code you are running?
autorun6464
(Anmol Timilsina)
January 28, 2025, 5:25pm
5
Its a refresh rule code … but looks like its working if i try with detect deleted group option … maybe that could be issue?
iamksatish
(Satish Kurasala)
January 28, 2025, 5:31pm
6
Why are you unselecting detect delete in first place, any specific reason? looks for deleted groups in target its not setting because its obvious for those groups this rule will not trigger and your owner will not be set.
system
(system)
Closed
March 29, 2025, 5:32pm
7
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.