Applying Org Fields to Ticket Custom Fields (Only When Condition is Met) | Community
Skip to main content

Applying Org Fields to Ticket Custom Fields (Only When Condition is Met)

  • March 12, 2025
  • 3 replies
  • 0 views

Faith11

Hello,

I currently use this code:

{
 "ticket": {
   "custom_fields": [
     {
       "id": field_ID,
       "value": "{{ticket.organization.custom_fields.name}}"
     }
   ]
 }
}
 

This code automatically pulls the organization field into a custom ticket field when a ticket is created.

 

However, I want this action to apply only when the ticket requester’s email does not contain a specific domain (e.g., @sample-email.com). Is there a way to exclude tickets from requesters with certain email domains from this action?

 

Thank you!

3 replies

Tipene
  • March 24, 2025
Hi Faith,
 
Could you share the context of where this code is being run i.e via a webhook, ZAF app, or somewhere else?

Faith11
  • Author
  • March 31, 2025

Hi @tipene, I'm using a Zendesk Webhook and Trigger for this action.

 

Here are my reference for this: 

Pulling Organization fields into ticket's custom field

Pulling custom Org fields into ticket


Tipene
  • April 16, 2025
Hi Faith,
 
Thank you for the clarification! Unfortunately, you cannot directly fire the trigger action based on the requester's email address. However, depending on your workflow, there are a few alternatives to achieve this. One approach is to utilize user mapping to assign an organization to a user based on their email domain, and then exclude that specific organization from the trigger action. Another option is to implement middleware that can process the webhook request, allowing you to verify the requester's email before sending an API request to update the custom field. 
 
I hope this helps! Let me know if you have any questions.
 
Tipene