Agents
This guide covers Zendesk agent management at GitLab, including the automated agent sync process and manual agent administration. The agent sync automatically maintains agent metadata from GitLab’s team data, while manual processes are used for provisioning and special cases.
Administrators should review the Administrator tasks section.
Understanding Zendesk agents
What are Zendesk agents
Zendesk agents are team members with access to the agent workspace. Unlike end-users who can only submit and view their own tickets, agents can:
- View and manage all tickets
- Access internal notes and fields
- Use macros and triggers
- Perform administrative tasks (based on role)
We largely manage agents via the agent sync (for the Customer Support Operations and Support teams) and via the provisioning/deprovisioning process.
Agent sync
Technical Details
- Deployment type:
Ad-hoc - Project repos
The agent sync manages metadata for Customer Support and Customer Support Operations team members in Zendesk. Other agent accounts (integrations, bots, etc.) are managed manually.
When does it run
- Zendesk Global: 0000 UTC every day
- Zendesk US Government: 0000 Pacific every day
What does it manage
Each run will update the following for the agents:
- GitLab.com user ID (a custom User field)
- GitLab.com username (a custom User field)
- Zendesk Group membership
- Manager tag (a custom User field)
- Name
- Out of Office status (a custom User field)
- Signature
- Select user tags (see How does it work for more details)
- User region (a custom User field for Zendesk Global only)
Any modifications to the agent outside of the sync in Zendesk will be overridden by this.
How does it work
Note
- As an
Ownercannot be modified via API, this does not work for the system owner. They have to manage their user manually.
When the scheduled pipeline is triggered, two primary actions occur:
- A clone of the Support team YAML files occurs
- The
bin/syncscript runs
This script itself acts a bit differently depending on the Zendesk instance it is tied to
Zendesk Global
- It fetches the groups of the Zendesk instance.
- It reads the contents of the Support team YAML files
- Note it skips select users who should not be in the sync, either because they are not editable (the Owner) or not targets for the sync currently
- It fetches the user information for each user found in the YAML files via Zendesk
- It fetches a list of those on PTO (as per the
Support - Time Offcalendar’s entries) - It loops over each agent to compare:
- The Zendesk user data to the YAML user data, specifically:
- If the organization they are associated to is
GitLab - Their name and email
- Their alias (alternative display name in Zendesk), if they have opted into using one
- Their signature
- Their user fields
- Their tags, derived from:
- Their current title
- Who they report to
- A tag to enable article editing
- A tag to enable article publishing (if the YAML dictates they should have it)
- A shift tag (if their
working_hoursattribute in the YAML files indicates they should have one)
- Their default group (determined by meeting one of the following criteria, in the order they appear):
BPOfor those with an email containing[email protected]Support AMERfor those with a region containingAMERSupport APACfor those with a region containingAPACSupport EMEAfor those with a region containingEMEAGeneralfor anyone not meeting the above criteria
- If the organization they are associated to is
- It compares the user’s current Zendesk group memberships with the groups they should belong to (based on YAML data and default group logic). Groups missing from Zendesk are added; extra groups not in YAML are removed.
- The Zendesk user data to the YAML user data, specifically:
- It then performs updates, using the following API endpoints:
Zendesk US Government
- It fetches the groups of the Zendesk instance.
- It reads the contents of the Support team YAML files
- Note it skips select users who should not be in the sync, either because they are not editable (the Owner) or not targets for the sync currently
- It fetches the user information for each user found in the YAML files via Zendesk
- It fetches a list of those on PTO (as per the
Support - Time Offcalendar’s entries) - It loops over each agent to compare:
- The Zendesk user data to the YAML user data, specifically:
- If the organization they are associated to is
GitLab - Their name and email
- Their alias (alternative display name in Zendesk), if they have opted into using one
- Their signature
- Their user fields
- Their tags, derived from:
- Their current title
- Who they report to
- A tag to enable article editing
- A tag to enable article publishing (if the YAML dictates they should have it)
- A shift tag (if their group memberships indicate they should have one)
- Their default group (determined by meeting one of the following criteria, in the order they appear):
Generalif they have a role ofLight agentSupportfor anyone not meeting the above criteria
- If the organization they are associated to is
- It compares the user’s current Zendesk group memberships with the groups they should belong to (based on YAML data and default group logic). Groups missing from Zendesk are added; extra groups not in YAML are removed.
- Notes if the user is changing their PTO status (i.e. coming back from or leaving for)
- The Zendesk user data to the YAML user data, specifically:
- It then performs updates, using the following API endpoints:
Note: Due to the smaller team size in US Government, the sync automatically updates ticket assignees when agents return from or leave for PTO. This courtesy automation is not needed in Global due to the larger team size and existing coverage.
Requesting changes to the sync
To request the changes to the agent sync, please create a Feature Request issue (as it will require manual intervention by the Customer Support Operations team).
Administrator tasks
Note
- All sections in this section require
Administratorlevel access to Zendesk.
Modifying the agent sync
Warning
- This should only be done if there is a corresponding request issue (Feature Request, Administrative, Bug, etc.). If one does not exist, you should first create one (and let it go through the standard process before working it).
To modify the agent sync, you will need to create a MR in the project repo. The exact changes being made will depend on the request itself.
After a peer reviews and approves your MR, you can merge the MR. When the next deployment occurs, it will be synced to Zendesk.
Manually creating an agent
Warning
- This should never be done unless specified to be done via provisioning/deprovisioning.
To create an agent in Zendesk:
- Hover over
+ Addat the top-left of the page (when not on the admin panel) - Click
User - Fill out the
Name - Fill out the
Email - Ensure the
User typeis that ofStaff member - Set their
Roleaccordingly - Click
Add
7d49549f)
