Service Desk - Before Provisioning Rule

Hi All,
I am working on a Before Provisioning Rule and it is deployed to the tenant and attached to the SDIM.
I did testing to see if the rule is getting implemented, but looks like there is some issue with the rule. Looks like the rule is not able to get the source application name, rather it’s getting the target application name “Service Desk” in this case.

I would want to get the source application name, to match against an if condition, and if it matches, it would have to populate few mandatory fields in the SNOW ticket pertaining to that particular application.

I have a total of two application names added to the if condition in the Rule. But while getting the application name from the AccountRequest the rule is getting the target application name instead of the Source application name.

Do you have any possible solution for this scenario. The below are few lines that I figured would be the solution for this issue. Please let me know which one is the right in this context please
Instead of using
String appName = accountRequest.getApplicationName();
Can I use,
Application sourceApp = accountRequest.getApplication(context);
or
String appName = (String) accountRequest.get("source");
or
String appName = (String) plan.get("sourceAppName");

Thanks in Advance.

Hi @AnjanaAshok - You are getting the target app because you are getting the appName from the account request. Try just using:
String appName = application.getName();

Clarification, are you wanting the Source appName where the provisioning is executed or do you mean the application requested in SNOW?

I faced a similar scenario in SailPoint ISC with SDIM. In the Before Provisioning Rule, accountRequest.getApplicationName()was returning the target application name (“Service Desk” in our case) instead of the originating source application.

From what I observed, this happens because the rule executes in the SDIM provisioning context, so the AccountRequest is already associated with the target app.

In my testing:

accountRequest.getApplication(context)

was also resolving to the target application object.

The other options like:

(String) accountRequest.get("source");
(String) plan.get("sourceAppName");

only work if those attributes were explicitly populated earlier in the flow.

What worked better for us was:

  • capturing the source application name earlier in the workflow/transform layer

  • storing it as a custom AccountRequest/plan attribute

  • then reading that custom attribute inside the Before Provisioning Rule

Something like:

String sourceApp = (String) accountRequest.getAttribute("sourceApplication");

That gave us a reliable way to apply conditional logic and populate the required SNOW fields based on the originating application.

Hey @AnjanaAshok Welcome back to the community.

You’ve run into the same limitation that others have seen: in a before provisioning rule attached to SDIM, the AccountRequest object is already bound to the target application (Service Desk). That’s why both accountRequest.getApplicationName() and accountRequest.getApplication(context) resolve to the target, not the originating source.

How to Retrieve the Source Application Name

From SailPoint rule documentation and community examples:

  • Target application name
String targetAppName = accountRequest.getApplicationName();

Always returns the provisioning target (e.g., Service Desk).

  • Source application name
    You need to reference the provisioning plan or the account request’s source metadata:
String sourceAppName = plan.getSource().getName();

or

Application sourceApp = accountRequest.getApplication(context);
String sourceAppName = sourceApp.getName();

This gives you the originating source application (e.g., Active Directory, HR system).

  • Alternative approach
    Some implementations expose the source name directly:
String sourceAppName = (String) plan.get("sourceAppName");

But this depends on whether sourceAppName is populated in your provisioning plan object.

Recommended Pattern

The most reliable method is:

Application sourceApp = accountRequest.getApplication(context);
String sourceAppName = sourceApp.getName();

This ensures you’re pulling the source application tied to the account request, not the target.

Best Practice

  • Use accountRequest.getApplicationName() only when you need the target system.
  • Use plan.getSource().getName() or accountRequest.getApplication(context).getName() when you need the source system.
  • Always log both values during testing to confirm which one is being returned:
log.info("Target App: " + accountRequest.getApplicationName());
log.info("Source App: " + plan.getSource().getName());

In SailPoint ISC SDIM flows, accountRequest.getApplicationName() returns the target app (Service Desk) because the provisioning plan is already transformed for SDIM.

Best approach:

Use the original source application from the provisioning arguments or native identity attributes before SDIM transformation.

Hi All,
The correct solution was using

String appNameRaw = accountRequest.getApplicationName();
    String appName = null;
    if (appNameRaw != null) {
        appName = appNameRaw.contains(" [source]")
                  ? appNameRaw.substring(0, appNameRaw.indexOf(" [source]"))
                  : appNameRaw;

It was not working since the source name was having a trailing [source] to it which I noticed when I looked into the logs.
Example: Active Directory [source]. So stripping the [source] from the source name solved the issue.

This returned the source name (Application from the which deprovisioning is triggered) rather than the target source (Service Desk)