Assign a Manager to a Workflow Task Depending on the Priority
Let's assign a manager to a workflow task depending on the workflow item priority. For this example we use the IF function.
To create the rule:
1. Select a workspace, select an application inside a workspace, click «Fields».
2. Create the «Request Priority» (ID: Request_Priority) field of the List of Values type. This field is required for creating the list of priorities of a workflow item. Populate the list with the following values:
Value | ID (created automatically) |
---|---|
Low | Request_Priority.values.Low |
Medium | Request_Priority.values.Medium |
High | Request_Priority.values.High |
3. Create the «Manager» field of the User type. Select the «Calculated» check box in «Field Attributes» (the «Read Only» attribute will be set automatically) and type the expression in the «Field Expression» tab. Type the required account identifiers in the IF function, for example, «account.6» and «account.5». Add the identifier of a priority value as the IF condition, for example, «Request_Priority.values.High».
IF($Request_Priority == "Request_Priority.values.High", ID("account.6"), ID("account.5")) |
4. Click «Save».
5. Go to «Form». Drag the created fields to the workflow item form.
To check how it works, create a new workflow item, fill in the required fields and click «Save». Change the priority of the workflow item to change the manager.