Update account attribute in after operation rule

Which IIQ version are you inquiring about?

Version 8.X

Share all details related to your problem, including any error messages you may have received.

Hi ,

Due to a specific need we need to update an account attribute , is it possible to do it throught an after rule ?

for example if i get the accoutn with :

Link l = (Link) context.getUniqueObject(Link.class, Filter.and(Filter.eq("application.name", "appname"),Filter.eq("nativeIdentity", "XXXXXX")));

how can i update a multivalued attribute by replacing its old value ?

Thanks

Hi @massinissa,

yes you can use this method for searching an account or other(search, getObject, read from plan…).
A multivalued attribute is list of object, so you need create a list/array of the same type and put into attribute with setAttribute().

little question: Are you sure to change an account attribute in the after? with this, you have a value in SP for this attribute and another value in the target system

Hi,

Yes, we change the attribut value in SP with the actual value of the target system , which needs some processing ,

Thanks

ok, I understand.

So I think is better a CustomizationRule, there you have the link and you can work directly before the end of operation.
Is present a variable called object where you find the link

1 Like

Hi @massinissa ,

I am just trying to understand why there is a need to update the account attribute in an AfterOperationRule and not directly in the operation request body.

If the request being sent is not updating the account attribute, could you perhaps confirm the reason for this?

regards,

1 Like

It’s better to use before provisioning rule if you want to update attribute for same application .
All the operation will be serviced in one call and it would be easy for you to catch for any error or exception .

Hi @massinissa,

Ideally you should not be updating Link object directly.

Is there any specific case where you want to update the attribute which is just in SailPoint and not in target system?

If yes, then if you after provisioning/operation rule is present then you use that.

Please find the sample code for link changes. Feel free to make changes in the same.

List attributeList=(List) l.getAttribute("AttributeName");
		attributeList.add("New Value");
		
		l.setAttribute("AttributeName",attributeList);
		SailPointFactory.getCurrentContext().saveObject(l);
		SailPointFactory.getCurrentContext().commitTransaction();

If you want to do it in customization rule, then please use object available to check for account type object.

If there is any further question, then let us know the same.

Thanks

1 Like

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