How to get source ID from either accountRequest or sourceName in BeforeProvisioning rule

We have a BeforeProvisioning rule setup on our ServiceNow SDIM integration and in it I am trying to get the source ID to use it for getting entitlement details. Is there a way for me to get the ID directly from the AccountRequest object itself?

Additionally, even though our integration runs on our VAs I can’t find the logs output by log.error() from the rule in the log files on the VAs, do rules on SDIM integration not log to VAs?

All Before Provisioning rules are cloud rules (even for Service Desk Integrations), so we have no direct access to logs generated within them unfortunately. You should be able to request them via a support ticket, though.

To answer your first question, you have to use a method not documented in the ISC rule Java Docs. If you have access to the IdentityIQ javadoc, you will find a few ways to access the target Application for an AccountRequest in an SDIM integration. When we developed a similar rule recently, I was only able to find one that didn’t get blocked by SailPoint’s internal rule validation check:

Application targetApplication = accountRequest.getApplication(context);
String sourceId = targetApplication.getId();