Applies to: SharePoint Online and On-Premises
Description
This article describes a way to implement round-robin selection using Crow Canyon NITRO Workflows. This articles takes the example of selecting a user from a group of users to whom Ticket should be assigned. You can use this concept to apply in other places where round-robin selection is required.
Summary of Steps
- Configure List Schema
- Create a list that has an entry for each selectable item
- Each item will maintain the count that will be used to determine the item that is selected in next iteration
- Configure Round robin assignment workflow
- Action 1: Configure Query list action to get the item with minimum count from list
- Action 2: Use the selected item (in this case to assign the Ticket to selected user)
- Action 3: Update the Count for selected item so that next item with lower count becomes eligible for selection
Detailed Steps
1. Configure List Schema
Create a list (i.e. Staff) for Staff members and maintain all the staff users in this list. That is, this list is for user to whom we want to auto-assign unassign Tickets in round-robin fashion
Create below fields:
Staff – This is the user column to whom Ticket will be assigned
- Internal Name: Staff
- Display Name: Staff
- Column Type: Person or group (Allow multi selection as required)
Count – This column will maintain the count and will be incremented with every selection to make the next user with lower count eligible for next selection
- Internal Name: Count
- Display Name: Count
- Column Type: Number (default value = 0)
Status – This column is used to temporarily or permanently remove an item from the round-robin selection
- Internal Name: Status
- Display Name: Status
- Column Type: Choice (Values: Active, Inactive, On Leave)
- Default value: Active
2. Configure Round Robin Assignment Workflow
Configure a timer based workflow as shown below. The objective of the workflow is to check for Tickets that remain unassigned for a certain period after creation and then assign them to staff users in round-robin fashion. That is, we will pick the user who has the lowest assignment count at this point and increment the count after assigning the Ticket to him.
Action 1: Configure Query list action to get the active users from the Staff list. This action will query the users and return the active user with minimum value in Count column.
Query:
<View>
<Query>
<OrderBy>
<FieldRef Name='Count' Ascending='True'/>
</OrderBy>
<Where>
<And>
<Eq>
<FieldRef Name='Status'/>
<Value Type='Choice'>Active</Value>
</Eq>
<Geq>
<FieldRef Name='ID'/>
<Value Type='Number'>1</Value>
</Geq>
</And>
</Where>
</Query>
<RowLimit Paged='False'>1</RowLimit>
</View>
Screenshot:
Action 2: Update the unassigned Tickets using staff from action 1
This action will update the Assigned Staff for the unassigned Ticket
Column Mapping:
Assigned Staff = $usercollection(QL-Staff##Staff)
Screenshot:
Action 3: Update the Count for Staff in Staff list
This action will update the Count for the assigned staff by 1 in Staff list
Column Mapping:
Count = $add(QL-Staff##Count,1)
Screenshot: