# Service Desk - Before Provisioning Rule

**URL:** <https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, rules\
**Created:** [May 21, 2026, 7:25pm UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290 "2026-05-21T19:25:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnjanaAshok](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@AnjanaAshok](https://developer.sailpoint.com/discuss/u/AnjanaAshok)\
**Post date:** [May 21, 2026, 7:25pm UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290/1 "2026-05-21T19:25:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ryan\_toornburg](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ryan_toornburg/32/21550_2.png) [@ryan\_toornburg](https://developer.sailpoint.com/discuss/u/ryan_toornburg)\
**Post date:** [May 21, 2026, 10:24pm UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290/2 "2026-05-21T22:24:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Sumittomar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sumittomar/32/37534_2.png) [@Sumittomar](https://developer.sailpoint.com/discuss/u/Sumittomar)\
**Post date:** [May 22, 2026, 4:42am UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290/3 "2026-05-22T04:42:53Z")

</div>

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:

```auto
accountRequest.getApplication(context)

```

was also resolving to the target application object.

The other options like:

```auto
(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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Santhakumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/santhakumar/32/17329_2.png) [@Santhakumar](https://developer.sailpoint.com/discuss/u/Santhakumar)\
**Post date:** [May 22, 2026, 5:28am UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290/4 "2026-05-22T05:28:18Z")

</div>

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**

```auto
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:

```auto
String sourceAppName = plan.getSource().getName();

```

or

```auto
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:

```auto
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:

```auto
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:

```auto
log.info("Target App: " + accountRequest.getApplicationName());
log.info("Source App: " + plan.getSource().getName());

```

---

<div class="post-metadata">

**Author:** ![70daadca52466159b25a266a11e514f](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/70daadca52466159b25a266a11e514f/32/37734_2.png) [@70daadca52466159b25a266a11e514f](https://developer.sailpoint.com/discuss/u/70daadca52466159b25a266a11e514f)\
**Post date:** [May 23, 2026, 8:54am UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290/5 "2026-05-23T08:54:35Z")

</div>

> [@AnjanaAshok](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![AnjanaAshok](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@AnjanaAshok](https://developer.sailpoint.com/discuss/u/AnjanaAshok)\
**Post date:** [June 19, 2026, 4:35pm UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290/6 "2026-06-19T16:35:20Z")

</div>

Hi All,  
The correct solution was using

```auto
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)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 18, 2026, 4:35pm UTC](https://developer.sailpoint.com/discuss/t/service-desk-before-provisioning-rule/210290/7 "2026-08-18T16:35:32Z")

</div>

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