{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":9830,"path":"employee-service-management/employee-experience-foundation/business-rule-close-condition.md","title":"Configure business rule for close condition","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure business rule for close condition\n\nConfigure the business rule for close condition to auto-import the chats.\n\n## Before you begin\n\nRole required: admin\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Definition** &gt; **Business Rules**.\n\n2.  Click **New**.\n\n3.  On the form, fill in the fields.\n\n    In the Advanced tab, update the **Condition** and the **Script** fields.\n\n<table id=\"table_j3d_hxy_vqb\"><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\nName of the business rule\n\n</td></tr><tr><td>\n\nTable\n\n</td><td>\n\nTable to which the close condition is to be assigned.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nCheck this box\n\n</td></tr><tr><td>\n\nAdvanced\n\n</td><td>\n\nCheck this box\n\n</td></tr><tr><td>\n\nWhere to run\n\n</td><td>\n\n-   When: **async**\n-   Update: Check this box\n-   Filter Conditions: Apply the filter condition of the close condition business rule\n\n\n</td></tr><tr><td>\n\nAdvanced\n\n</td><td>\n\n-   Condition: Copy and paste the value of the condition. Modify the values as required.\n\n    ```\n!current.avoid_closing_chat_records && new sn_tcm_collab_hook.MSTeamsImportChatUtils().hasMatchingCloseCondition(current)\n    ```\n\n-   Script: Copy and paste the value for the script. Modify the values as required.\n\n    ```\nnew sn_tcm_collab_hook.MSTeamsImportChatUtils().closeChatStorageRecords(current);\n    ```\n\n</td></tr></tbody>\n</table>4.  Click **Submit**.\n\n\n**Parent Topic:**[Customize IT Service Management integration with ServiceNow](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/employee-experience-foundation/customize-sn-ms-teams.md)\n\n"}}