Use custom user fields in trigger

3 Comments

  • Ahmed Zaid

    Hello Tracy Powell,

    You can certainly do so using {{user.custom_fields.your_field_key.title}} for text values of drop-down fields and {{user.custom_fields.your_field_key}} for tag in drop-down fields or actual value in all other field types.

    You need to replace "user" with the context user. Here is how Zendesk explains it:

    In the context of updating a ticket, there are a number of different types of users. These include the following:
    • ticket.requester, who is the person who requested the ticket
    • ticket.assignee, who is the agent assigned to the ticket
    • ticket.submitter, who is either the user who submitted the request or the agent that opened the ticket on behalf of the requester
    • current_user, who is the user currently updating the ticket (an end-user or agent)

    Keep in mind that you will need the alphanumeric "key" you defined while creating the field. This is different from the field_id that you obtain from ticket custom fields.

    So here is an example of ticket requester's "subscription_type":

    {{ticket.requester.custom_fields.subscription_type.title}}

    Pro tip:

    This is the ultimate go to guide for placeholders. I recommend bookmarking it.

     

    Best Regards,
    Ahmed

    0
  • Tracy Powell

    Fabulous! Thanks, Ahmed. I wasn't able to find that placeholders article via web search. It would be really great to have something within the app pointing me to this content when I need it - like here when defining a trigger body:

    Or equally heplful, even just adding an example like this to the list:

    {{current_user.custom_fields.your_field_key}}
    0
  • Ahmed Zaid

    I agree that the menu is not sufficient. Before I found the placeholder reference article, I had hard time finding the syntax of placeholders I needed.

    It seems that the menu only lists placeholders that are literally available. I would love to see at least a link to the reference to indicate that there are more options.

    Hint: you can always request features and provide feedback here.

    0

Please sign in to leave a comment.

Powered by Zendesk