# Automatically create a ticket when replying to an old email thread

**URL:** <https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732>\
**Category:** Tips, Tricks & Best Practices\
**Tags:** email, workflows, developer-tools, contacts\
**Created:** [June 6, 2023, 10:37am UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732 "2023-06-06T10:37:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoseGLS](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@JoseGLS](https://community.hubspot.com/u/JoseGLS)\
**Post date:** [June 6, 2023, 10:37am UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732/1 "2023-06-06T10:37:26Z")

</div>

Hi,

We have an inbox connected that will create a Ticket when a contact sends us an email. It works except when a contact replies to an old email thread (before the inbox was connected). In that case, the inbox workflow won’t create a ticket but it will create a new activity for the email reply to the Activities tab of the contact. We contacted a Hubspot specialist and they confirmed that this behavior seems to be correct.

How could we automatically create a ticket for these cases? I tried different ways but all of them seem to be missing something:

- Contact Workflow with an Enrollment trigger as Activity Email subject is Known: however there is no filter type for “contact doesn’t have any ticket”.
- Hubspot API/Webhook: we can trigger a webhook when the property notes\_last\_updated (last activity date) changes, however, there is no API to retrieve all the activity of a contact.

Any help? Thank you!

---

<div class="post-metadata">

**Author:** ![MiaSrebrnjak](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miasrebrnjak/32/10_2.png) [@MiaSrebrnjak](https://community.hubspot.com/u/MiaSrebrnjak)\
**Post date:** [June 7, 2023, 10:17am UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732/2 "2023-06-07T10:17:33Z")

</div>

Hi @JoseGLS,

Thank you for reaching out to the Community!

I wanted to tag in a couple of subject matter experts to see of they can think of a workaround:

Hi @danmoyle, @franksteiner79, @HFisher7, do you have any tips for @JoseGLS? Thank you!

Cheers  
Mia, Community Team

---

<div class="post-metadata">

**Author:** ![HFisher7](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hfisher7/32/101931_2.png) [@HFisher7](https://community.hubspot.com/u/HFisher7)\
**Post date:** [June 7, 2023, 10:28am UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732/3 "2023-06-07T10:28:52Z")

</div>

@JoseGLS - You could create a custom calculation contact property ‘Number of associated tickets’ that sums up the number of ticket records associated to the contact:

 ![Screenshot 2023-06-07 at 11.27.32.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/f/2f4a6d4a9ad654041575437daf4a1db75c5b411f.png)

You could then use this property in your workflow along with the Email subject known trigger:

 ![Screenshot 2023-06-07 at 11.28.36.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/1/815adfb43bfd310498a0f5daa6817fc9ff8cd102.png)

---

<div class="post-metadata">

**Author:** ![danmoyle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danmoyle/32/91166_2.png) [@danmoyle](https://community.hubspot.com/u/danmoyle)\
**Post date:** [June 7, 2023, 7:48pm UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732/4 "2023-06-07T19:48:49Z")

</div>

I’m with @HFisher7 here, @JoseGLS. That’s where I’d start, too.

Thanks for the tag @MiaSrebrnjak!

---

<div class="post-metadata">

**Author:** ![JoseGLS](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@JoseGLS](https://community.hubspot.com/u/JoseGLS)\
**Post date:** [June 8, 2023, 11:51am UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732/5 "2023-06-08T11:51:31Z")

</div>

@HFisher7 Thank you for your answer.

 ![Screenshot 2023-06-08 at 12.46.21.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/7/57e26a3f9091793287a1afb8d3ee5826b8112ae6.png)

My interface for creating a custom property for contacts seems to be a bit different.  
After choosing “Ticket”, it asks for a mandatory ticket property. There is no property related to “associated to the contact” so the result of the calculation is the sum of ALL existing tickets.  
Thank you.

---

<div class="post-metadata">

**Author:** ![HFisher7](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hfisher7/32/101931_2.png) [@HFisher7](https://community.hubspot.com/u/HFisher7)\
**Post date:** [June 8, 2023, 12:55pm UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732/6 "2023-06-08T12:55:01Z")

</div>

@JoseGLS - Once you click create on the property you will get the view I shared, looks like you’ve done the same as me from your screen share 🙂

---

<div class="post-metadata">

**Author:** ![AShukla38](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ashukla38/32/29042_2.png) [@AShukla38](https://community.hubspot.com/u/AShukla38)\
**Post date:** [June 21, 2023, 6:17am UTC](https://community.hubspot.com/t/automatically-create-a-ticket-when-replying-to-an-old-email-thread/82732/7 "2023-06-21T06:17:05Z")

</div>

You can 1stly set revert from here

 ![AShukla38_0-1687328188206.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/2/82cf47534c249a09ccb441e124768e7adb03f5cc.png)

Then by using this revert as a trigger you can create a new ticket.
