Question
Can I add a tag to a user with a trigger action? How can I check if a user tag was added by a trigger?
Answer
You can't directly add user tags to a user's profile using a trigger action. As a workaround, create a custom workflow using the Requester | custom user field, which will then add a tag.
Create a custom user field
- Create a custom user field and select the drop-down field type.
- Add the user field values along with the associated tags that the trigger will apply. This example adds the
vip
user tag. - Click Save.
Create a trigger
- Create a trigger and apply the conditions to which the user tag should be applied.
- Select Actions > Add action > Lookup relationships and add the below condition:
-
Requester | Custom user field name |
value
- Click Save.
The trigger will add the vip
tag to the user and any subsequent tickets from that user.
Verify if a user tag was added by a trigger
Use the below steps to verify if a user tag has been added by a trigger.
- Locate the custom user field ID that includes the user tag value. This will appear in Admin Center when the user field setting is selected.
- Locate the user field's value ID that applied the tag by using the following API endpoint. Enter your subdomain and the user field ID found in Step 1.
https://yoursubdomain.zendesk.com//api/v2/user_fields/fieldID
- Enter your subdomain using the following trigger API endpoint:
https://yoursubdomain.zendesk.com/api/v2/triggers/active.json?active=true&page=1
- Search for the user field value ID from Step 2 in the active trigger list. The trigger or triggers name that includes the custom user field value and the tag will be listed.