Extract an 8-digit number from the ticket subject line and paste it in a custom ticket field with a webhook. | Community
Skip to main content

Extract an 8-digit number from the ticket subject line and paste it in a custom ticket field with a webhook.

  • February 12, 2025
  • 1 reply
  • 0 views

Herbert,

Hi there, 

 

I have a challenge out there for anyone who is savvy with Webhooks and Liquid Markup. We'd like to have a webhook extract an 8-digit number from the tickets subject and paste it in a custom ticket field when a ticket is created. 

The value will always be 8-digits and always be between two slashes, i.e.  “/12345678/”

For example, if the subject of the ticket is: 

"Test Ticket Example /12345678/ New Request", then we want “12345678” to populate in a custom field when the ticket is created. I feel like this is possible with a webhook, but not sure exactly how to set it up.

 

Thanks!

 

Rich

1 reply

Rj22
  • June 21, 2025

Hi @Herbert, Rich ,

 

You can use the following Liquid syntax and parameters in the trigger action for your webhook:
 

{% assign parts = {{ticket.title}} | split: '/' %}

{% assign number = parts[1] %}

{

   "ticket": {

       "custom_fields": [{

         "id": 31070228268441,

         "value": "{{ number }}"

       }]

   }

}

This sample code will capture the 8 digits from the ticket title and update the custom ticket text field with ID 31070228268441 to this extracted number.
 

I have tested this and it is working as expected. Please give it a try. Thank you.