Skip to main content

Push Custom Ticket Fields from Gorgias to Retently

How to send Gorgias custom ticket fields (such as Contact Reason) to Retently as contact properties using the HTTP integration.

Written by Alex Bitca

The standard Gorgias HTTP integration supports a set of built-in ticket variables like email, ticket ID, and assignee name. Custom ticket fields, such as a Contact Reason field you created in your Gorgias account, are not available as simple variables. They require a different approach to pass the value to Retently.

This article walks you through the full setup: finding the field ID in Gorgias, creating a matching property in Retently, and updating the JSON payload with the correct template.

Before You Start

This guide assumes you already have the Retently HTTP integration set up in your Gorgias account. If not, complete that setup first before continuing here. Learn more.

Step 1: Find the Custom Field ID in Gorgias

Custom ticket fields in Gorgias are identified by a numeric ID, not by their display name. You need this ID to reference the field in your JSON payload.

  1. In Gorgias, go to Settings.

  2. Open Ticket Fields from the left menu.

  3. Click on the custom field you want to push to Retently (for example, Contact Reason).

  4. Look at the URL in your browser's address bar. The numeric ID appears at the end of the URL.

For example, if the URL is:

https://youraccount.gorgias.com/app/settings/ticket-fields/254633

Then the field ID is 254633.

Copy this ID somewhere handy. You will need to paste it in three places in the next step.

Step 2: Create a Custom Property in Retently

Before you can receive the field data, you need a matching property in Retently to store it.

  1. In Retently, go to Settings → Contact Attributes.

  2. Add a new contact property.

  3. Set the type to Text.

  4. Name the property in lowercase, with spaces replaced by underscores. For example: "contact_reason".

The property name you set here must match exactly what you will use as the key in the Gorgias JSON payload in the next step.

Step 3: Update the JSON Payload in Gorgias

  1. In Gorgias, go to Settings → Integrations.

  2. Find your Retently HTTP integration and click on it.

  3. Scroll down to the JSON payload section.

  4. Add a new line for your custom field, using this template:

"contact_reason": "{% set custom_field_value = ticket.custom_fields['YOUR_FIELD_ID'].value if ticket.custom_fields and 'YOUR_FIELD_ID' in ticket.custom_fields and ticket.custom_fields['YOUR_FIELD_ID'].value is defined else 'None' %}{{ custom_field_value }}"
  • Replace `YOUR_FIELD_ID` with the numeric ID you found in Step 1. It appears three times in the template, replace all three.

  • Replace `contact_reason` (the key on the left) with the exact property name you created in Retently.

Finally, save the changes.

The template uses Jinja, a standard Python templating language that Gorgias supports in HTTP integrations. It safely handles cases where the custom field has no value by returning `None` instead of causing an error.

How Values Look When They Arrive in Retently

Some custom fields in Gorgias have a nested structure with a subcategory and a value. For example, the Contact Reason field might have:

  • Subcategory: Order

  • Value: Cancel

When this is sent to Retently, the two levels are combined into a single string: "Order::Cancel".

This matters when you set up filters.

Using the Field in Retently Filters

Once your surveys are triggering and the field is being sent, the contact_reason property appears in your filter options.

Exact match: works when you know the specific value and want to isolate it precisely. For example, filtering for "Order::Cancel" shows only responses where that exact combination was sent.

Contains: is more flexible. Filtering for "contains > order" matches any value that includes the word "order", such as "order cancel", "order protection missing item", or "order delayed". This is useful when you want to group all responses related to a broad subcategory.

The filter dropdown will populate with values automatically as responses come in, so you do not need to type them manually after the first few surveys have been triggered.

Pushing Additional Custom Fields

You can repeat this process for any other custom ticket field in Gorgias. For each one:

  1. Find its numeric ID in Settings → Ticket Fields.

  2. Create a matching property in Retently.

  3. Add a new line in the JSON payload, replacing the field ID and the property name.

Each custom field gets its own line in the JSON payload and its own property in Retently.

Did this answer your question?