---
title: Controlling Default Service Orders with Role Conditions
slug: controlling-default-service-orders-with-role-conditions
docTags: 
createdAt: 2025-07-30T04:10:40.730Z
---

## Description

This article explains how to configure **Default Service Orders** so they only run when users meet specific role-based conditions. This is achieved by adding conditions directly to the Default Service Order configuration.

## Use Case

An organisation has a service called **Building Access**, which creates a ticket or process to grant users access to a specific location.

Retail department users are provisioned with multiple default services during the **Create User** process. The requirement is:

- The **Default Service Order** should only run if the user:
  - Is a member of a specific **Department Role** (e.g., Retail Department), **AND**
  - Is a member of a **Location Role** (e.g., a retail store such as Ponsonby).

## Solution

### 1. Add Role Conditions to the Default Service Order

You can add conditions to a Default Service Order to ensure it only applies when the user is assigned specific roles. For example:

:::BlockQuote
cppCopyEditDefaultUserServiceOrder\::Ponsonby
:::

Where Ponsonby is the role name for the required location.

If multiple roles are involved, you can include multiple conditions to ensure the service only runs when all required roles are present.

### 2. Implementation Considerations

- Ensure the roles you reference in the condition are assigned before the Default Service Order evaluation occurs.
- If role assignment and Default Service Order evaluation happen in the same process, confirm the sequence supports this dependency.
- Test in a non-production environment to validate the logic before deploying.

## Example Workflow

1. Identify the role names required for your condition (e.g., **RetailDepartment**, **Ponsonby**).
2. Edit the Default Service Order configuration to include the role condition using the DefaultUserServiceOrder\::RoleName syntax.
3. Save and test the configuration to confirm the service order runs only for users who have both roles.

