{"section":"tutorials","requestedLocale":"en","requestedSlug":"using-groups-to-organize-human-attendance","locale":"en","slug":"using-groups-to-organize-human-attendance","path":"docs/en/tutorials/vtex-cx-platform/live-desk/using-groups-to-organize-human-attendance.md","branch":"main","content":"When a contact initiates human support on [Live Desk](https://help.vtex.com/docs/tutorials/live-desk-overview), the chatbot remains active in the background. If no action is taken, the automated messages configured in the triggers can be activated during the conversation and interrupt the service. To avoid this conflict, use a **control group**: a [static group](https://help.vtex.com/docs/tutorials/static-groups) that includes all contacts currently in human support and should be ignored by triggers.\n\n> ⚠️ If contacts aren't added to a control group, the chatbot will conflict and interrupt human support by sending the default messages configured in your environment.\n\nIn this article you'll learn how to:\n\n- [Create the control group](#create-the-control-group)\n- [Add contacts to the control group](#add-contacts-to-the-control-group)\n- [Ignore the control group in triggers](#ignore-the-control-group-in-triggers)\n- [Remove contacts from the control group](#remove-contacts-from-the-control-group)\n- [Submit custom fields in the ticket](#submit-custom-fields-in-the-ticket)\n\n## Create the control group\n\nThe control group is a static group, meaning contacts are added and removed manually or through action cards in flows. To create it, follow these steps:\n\n1. Go to the organization and project you want to modify in the [VTEX CX Platform](https://dash.weni.ai/orgs).\n2. In the sidebar menu, click **Contacts**.\n3. Click `Create Group`.\n4. In the popup, enter the group name (for example, _Human Support_) and click `Create`.\n\nThe group will be listed alongside other contact categories in the sidebar menu. For more details, see the article [Static groups](https://help.vtex.com/en/docs/tutorials/static-groups).\n\n## Add contacts to the control group\n\nThe contact should enter the control group in the same [automation flow](https://help.vtex.com/docs/tutorials/automation-flow-overview) where the human support ticket is opened. This way, they're controlled when the conversation is directed to an agent.\n\nIn the flow where you use the **Open a ticket with a human agent** action card, also add the **Add a contact to a group** action card and select the _Human Support_ group. To do this, follow these steps:\n\n1. Go to the organization and project you want to modify in the [VTEX CX Platform](https://dash.weni.ai/orgs).\n2. In the sidebar menu, click **Automation Flow**.\n3. Click the name of the flow responsible for opening the ticket.\n4. Inside the flow, click the initial block.\n5. In the popup, under **When a contact arrives at this point in your flow...**, select the option **Add the contact to a group**.\n6. In **Select the groups to add the contact to**, select the `Human Support` group.\n7. Click **Confirm**.\n8. Position this new block next to the **Open a ticket with a human agent** block, so the contact enters the group when starting the service.\n9. Save the flow changes.\n\n> ⚠️ If you open tickets in different flows, you must add this card to all flows that direct contacts to human support.\n\nTo learn more about these cards, see the article [Action cards](https://help.vtex.com/docs/tutorials/action-cards).\n\n## Ignore the control group in triggers\n\nAfter adding the contact to the group, configure each project trigger to ignore contacts in the _Human Support_ group. This prevents the chatbot from interrupting the service. To do this, follow these steps:\n\n1. Go to the organization and project you want to modify in the [VTEX CX Platform](https://dash.weni.ai/orgs).\n2. In the sidebar menu, click **Contacts**.\n3. Click **Triggers**.\n4. Click a trigger configured in your project.\n5. In the **Groups to Exclude** field, select the _Human Support_ group.\n6. Click `Save changes`.\n7. Repeat the process for **all triggers** in the project.\n\nThis way, while the contact is in the control group, they won't be activated by automated messages, and human support will continue without interruptions. For more information about triggers, see the articles [Adding a trigger](https://help.vtex.com/docs/tutorials/adding-a-trigger) and [Trigger types](https://help.vtex.com/docs/tutorials/triggers-types).\n\n## Remove contacts from the control group\n\nIt's important to remove the contact from the control group when the human support session is completed. Otherwise, they'll continue to be ignored by triggers even after the service ends.\n\nThis automation involves two elements with distinct functions:\n\n- A **closing flow**, which removes the contact from the control group.\n- A **trigger**, which starts this flow whenever a Live Desk ticket is closed.\n\nTherefore, first create the closing flow and then the trigger that activates it.\n\n### Create the closing flow\n\nThe closing flow requires only one block with the **Remove contact from a group** action card, which removes the contact from the control group. To create it, follow these steps:\n\n1. Go to the organization and project you want to modify in the [VTEX CX Platform](https://dash.weni.ai/orgs).\n2. In the sidebar menu, click **Automation Flow**.\n3. Click `Create flow` and enter a name for the flow (for example, _Service closure_).\n4. Inside the flow, click **Create block**.\n5. In the popup, under **When a contact arrives at this point in your flow...**, select the option **Remove the contact from a group**.\n6. In **Groups that the contact will be removed:**, select the _Human Support_ group.\n7. Click **Ok**.\n8. Save the flow changes.\n\n### Create the closing trigger\n\nAfter creating the flow, configure the trigger that starts it automatically when a ticket is closed. To do this, follow these steps:\n\n1. Go to the organization and project you want to modify in the [VTEX CX Platform](https://dash.weni.ai/orgs).\n2. In the sidebar menu, click **Contacts**.\n3. Click **Triggers**.\n4. Click `Create trigger`.\n5. Click **Start a flow after a ticket is closed**.\n6. In **Flow**, select the closing flow you created earlier.\n7. Leave the **Groups to Exclude** field empty to apply the trigger to all contacts.\n8. Click `Create trigger`.\n\nThis way, when closing the ticket, the trigger starts the closing flow, which removes the contact from the control group. Thus, the contact can interact normally with the chatbot again.\n\n## Submit custom fields in the ticket\n\nWhen opening the ticket with the **Open a ticket with a human agent** action card, you can submit custom fields for the service. These fields must be defined in the body of this card, in JSON format, with each field as an attribute of `custom_fields`, represented by its key and value.\n\nThe example below configures the `origin` field, whose value is defined by a flow result (`origem`). Since the value is text type, it's specified in quotes:\n\n```json\n{\n  \"custom_fields\": {\n    \"origin\": \"@results.origem\"\n  }\n}"}