You can use nativeIdentity from the accountRequest object and just iterate over identities links to find Link object with this nativeIdentity and application. This will give you access to all currently set attributes in the account. Something like that:
Each account request is always for.single application which you can check eg by. accountRequest.getApplicationName(); and each account.re1uest contains list of AttributeRequests (1 attribute request for each attribute) which you can get by accountRequest.getAttributeRequests();
In the current version your link is available as a separate object itself so it should not be a problem to query it.
In earlier version where your Link object is not directly available there you can use “IdentityService” API to get the link directly if it is for the same identity on which your operation is triggered.
One note: If you do it this way, you should qo.setCloneResults(true) and qo.setCacheResults(false), which will cause Hibernate to fully detach the Link object from the session and make sure everything is loaded into memory.
You will run into strange and difficult-to-debug caching errors if you don’t. That same Link object is already loaded into the Hibernate cache elsewhere via the Identity whose access is being provisioned.
An alternative approach to getting values in your beforeOperation rule is to add it to the provisioningPlan as an accountRequest attribute.
You can use your before provisioning rule to add if to the accountRequest directly from the Identity as accountRequest.setArgument(string, string).
I wrote a blog post that addresses this for IDN, but the same code works for IIQ. Additionally, as SailPoint is trying to transition IIQ implementations to IDN, using this approach would mean less code changes should you ever migrate platforms: