{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":7329,"path":"customer-service-management/t_CreateARoutingRule.md","title":"Create a matching rule for case routing","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a matching rule for case routing\n\nCreate a matching rule for a customer service case that identifies the case attributes as well as the agent resources.\n\n## Before you begin\n\nRole required: assignment\\_rule\\_admin\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Routing and Assignment** &gt; **Matching Rules**.\n\n2.  Click **New**.\n\n3.  Fill in the fields on the Matching Rule form.\n\n    This form contains the following sections:\n\n    -   Basic rule information\n    -   Applies to: use this section to create rule conditions\n    -   Resource: use this section to create agent and agent group conditions\n<table id=\"table_czw_ftc_nr\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nThe name of the matching rule.\n\n</td></tr><tr><td>\n\nExecution order\n\n</td><td>\n\nThe order in which this matching rule is to be executed. Similar to business rules, matching rules are processed based on execution order, from the lowest to the highest.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nEnable this check box to activate the matching rule.\n\n</td></tr><tr><td class=\"subhead\" colspan=\"2\">\n\nApplies To\n\n</td></tr><tr><td>\n\nTable\n\n</td><td>\n\nThe table that stores the task for which the matching rule is being created. The default is the Case \\[sn\\_customerservice\\_case\\] table.\n\n</td></tr><tr><td>\n\nConditions\n\n</td><td>\n\nUse the buttons in this field to build one or more conditions on the selected table. A condition is made up of a selected field, an operator, and a value. Add conditions using the **AND** and **OR** buttons. Delete conditions by clicking the **X** to the right of a condition.\n\n</td></tr><tr><td class=\"subhead\" colspan=\"2\">\n\nResource\n\n</td></tr><tr><td>\n\nMatching\n\n</td><td>\n\nThe type of resource matching method to use for this rule: Simple, Advanced, Scripted, Selection Criteria. Select **Simple** to assign a task to a specific user.\n\n1.  Click the lookup icon next to the **Resource** field.\n2.  Select a **Table name**.\n3.  Select a **Document** from the table.\n4.  Click **OK**.\n Select **Advanced** to create a specific set of resource conditions. Then use the condition builder in the **Resource** field to identify these conditions.\n\n Select **Scripted** to create a customized script for identifying resources, with the goal of returning a list of users that have the same skills as the task. The task under consideration is set in the context of the script. For example:\n\n ```\n//current has the task record for which the rule is being executed.\nvar task = current;\nvar skills = task.getValue(\"skills\");\nvar skillUtil = new global.SkillsUtils();\nvar skilledUsers = skillUtil.getAllSkilledUserIds(skills);\nreturn skilledUsers;\n```\n\n</td></tr><tr><td>\n\nResource\n\n</td><td>\n\nThis field changes depending on the resource matching type selected in the **Matching** field. For **Simple** matching, use this field to select a table and a user.\n\n For **Advanced** matching, use the condition builder in this field to build one or more conditions to identify a resource. These conditions can be based on user role, agent group, specific skills, work load, or agent availability.\n\n</td></tr><tr><td>\n\nSchedule based filtering\n\n</td><td>\n\nThis field applies to **Advanced** matching. Enable this check box to filter resources that are in schedule \\(work hours\\) at the time of routing.\n\n</td></tr><tr><td>\n\nScript\n\n</td><td>\n\nFor **Scripted** matching. use this field to create a customized script for identifying resources. An example script is included. The expected return from a customized script is an array of resource sys\\_ids.\n\n</td></tr></tbody>\n</table>4.  Click **Submit**.\n\n    The rule appears in the Matching Rules list.\n\n5.  Open the newly created rule from the Matching Rules list and add the desired matching criteria.\n\n6.  From the **Select Criteria** related list, click **New**.\n\n7.  Select a **Criterion**.\n\n8.  In the **Use for** field, specify how you want the matching criterion to be used.\n\n<table id=\"choicetable_wzv_ztm_sx\"><tbody><tr><td id=\"d124856e355\">\n\n**Ranking and display**\n\n</td><td>\n\nUse the criterion to determine agent ranking and displays it in a column on the workbench.\n\n</td></tr><tr><td id=\"d124856e364\">\n\n**Display only**\n\n</td><td>\n\nDisplays the criterion in a column on the workbench but does not use it to determine agent ranking.\n\n</td></tr><tr><td id=\"d124856e373\">\n\n**Ranking only**\n\n</td><td>\n\nUses the criterion to determine agent ranking but does not display it on the workbench.\n\n</td></tr></tbody>\n</table>9.  Select a **Ranking Method**.\n\n<table id=\"choicetable_ccn_j5m_sx\"><tbody><tr><td id=\"d124856e394\">\n\n**More is better**\n\n</td><td>\n\nFor example, more availability is better when determining the agent ranking.\n\n</td></tr><tr><td id=\"d124856e403\">\n\n**Less is better**\n\n</td><td>\n\nFor example, fewer assigned cases are better when determining agent ranking.\n\n</td></tr></tbody>\n</table>10. Click **Submit**.\n\n    The criterion appears on the Matching Rule form in the **Select Criteria** related list.\n\n11. From the **Select Criteria** related list, set a **Threshold** for the criterion.\n\n    A threshold sets a minimum requirement for a criterion. If necessary, personalize the list and add the **Threshold** field.\n\n\n"}}