# Way to limit Discourse-Zapier to only run on first post

**URL:** https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938
**Category:** Support
**Created:** [August 27, 2019, 2:51pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938 "2019-08-27T14:51:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Kyle\_Selby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyle_selby/32/149687_2.png) [@Kyle\_Selby](https://meta.discourse.org/u/Kyle_Selby)
#### Post date: [August 27, 2019, 2:51pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/1 "2019-08-27T14:51:27Z")

</div>

I created a setup where each time a post is created in a specific category a Jira ticket is also created using Zapier. The issue I am running into is that each time someone edits a post and publishes it again another Jira ticket is created (it’s seeing it as a new post again). Is there any way to prevent this? I am not sure if there is some kind of unique identifier that says a post is original and has not been edited before that I can reference to prevent this from happening?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [August 27, 2019, 3:39pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/2 "2019-08-27T15:39:30Z")

</div>

There is a header in the webhook request named `X-Discourse-Event` which should indicate if the post is a new one or an edit.

---

<div class="post-metadata">

### Author: ![Kyle\_Selby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyle_selby/32/149687_2.png) [@Kyle\_Selby](https://meta.discourse.org/u/Kyle_Selby)
#### Post date: [August 27, 2019, 3:59pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/3 "2019-08-27T15:59:15Z")

</div>

For some reason I am not seeing that in the options showing within the webhook. Am I missing something? Or is it named something different? I would assume that post number would work for this, but it appears to count an edit as a new post number. Here is the list of webhook titles available to me:

 ![List%20of%20webhook%20options](https://global.discourse-cdn.com/meta/original/3X/7/8/78673d9deacc149a49901e22d20881350ff0d9ef.png)

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [August 27, 2019, 4:21pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/4 "2019-08-27T16:21:33Z")

</div>

> [@Kyle\_Selby](#):
>
> For some reason I am not seeing that in the options showing within the webhook.

To get access to the webhook headers on Zapier, I think you will need to use the ‘Catch Raw Hook’ option for the webhook on Zapier. This topic gives an example of how to do that for a User Event webhook: [Create a Salesforce lead via Zapier when a user signs up on Discourse](https://meta.discourse.org/t/create-a-salesforce-lead-via-zapier-when-a-user-signs-up-on-discourse/109301). Setting up a Zap to listen for a Post Event webhook and filter out all requests where the `X-Discourse-Event` is set to `post_edited` will be quite similar.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 27, 2019, 5:36pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/5 "2019-08-27T17:36:39Z")

</div>

The down side of that approach is that you have to process a whole bunch of topic events that you know that you don’t want, so it ends up being expensive.

Having a New Topic event seems like a good idea.

---

<div class="post-metadata">

### Author: ![Kyle\_Selby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyle_selby/32/149687_2.png) [@Kyle\_Selby](https://meta.discourse.org/u/Kyle_Selby)
#### Post date: [August 27, 2019, 5:48pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/6 "2019-08-27T17:48:54Z")

</div>

Hi @pfaffman! Yep I currently have it set up as a new topic event, I just can’t figure out which of those fields to filter out to get rid of any posts after the original one (including any edits). Any ideas on how to do that?

---

<div class="post-metadata">

### Author: ![Kyle\_Selby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyle_selby/32/149687_2.png) [@Kyle\_Selby](https://meta.discourse.org/u/Kyle_Selby)
#### Post date: [August 28, 2019, 2:24pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/7 "2019-08-28T14:24:52Z")

</div>

Anyone have ideas on what field I can use to prevent the duplicate posts from being referenced?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 18, 2023, 9:27pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/8 "2023-03-18T21:27:35Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 29, 2023, 1:22pm UTC](https://meta.discourse.org/t/way-to-limit-discourse-zapier-to-only-run-on-first-post/126938/9 "2023-04-29T13:22:55Z")

</div>


