Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Webhook continually fires despite not matching filters

Erin Cochran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 25, 2019

Hey folks - I'm trying to get a webhook to fire only when the following conditions are met:

  • Issue comment is created, or
  • Issue comment is updated

And the issue comment contains the exact phrase docs-team. This is the JQL query I wrote for this:

comment ~ "docs-team"

The issue I'm seeing is that the webhook will continue to fire for comment events on the issue after the first time it finds docs-team in a comment, even if subsequent comments don't contain this phrase.

Am I missing something in the JQL, or something fundamental about how webhooks work? Help here would be appreciated!

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 6, 2019

Hi Erin,

I think I can see two different possible problems here with this approach

  1. The use of JQL in a webhook is not limiting the search results only to the comments made by the event that triggered that webhook.  It's also possible the issues returned by JQL could have past comments that are matching here.  Example, if you have an issue that had a previous comment of 'docs-team', then every subsequent issue comment creation/update will cause this webhook to fire for that issue, even if the latest comment does not contain that text.
  2. I'm afraid that in this case, JQL isn't doing an exact string match here.   Text fields have to use the CONTAINS:~ operator to start, these are not always exact string matches.  These can also be fuzzy matches. I understand you're wanting to match on 'docs-team' however because JQL does Word Stemming, it's possible you have a Comment that contains both the word 'docs' and the word 'team' but not the exact string you entered here.

I'm not sure the best solution here. Since native JQL is unlikely to be able to give you the exact string match I think you want here.  You might look into a plugin in Marketplace such as the JQL Search Extensions for Jira & reports.  I haven't used this one, but I found some documentation that appears to give you some level of using regex in JQL to use their Field Match that might help here. It could help at least in #2 of the problems here. It's likely there are other possible solutions to the JQL problem you could find in Marketplace as well.

Alternatively, I came across Comment Custom Fields for Jira, this plugin appears to offer the ability to store the last comment of an issue as a custom field on the issue. This could help with the first problem of matching on too many issues with the past term.  You could then just search for this custom field for the text, but again, you could still run into the problems of #1 even with this solution by itself.

I hope this helps.

Andy

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events