Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,841
Community Members
 
Community Events
168
Community Groups

How to fail incoming Webhooks JQL search gracefully?

Hi,

I have been writing some project automation and using incoming Webhooks from GitHub which is working great but I have one minor non fatal problem.

To find the issue number I use the JQL search feature (Issues provided by running the following JQL search) that extracts the issue from the webhookData.
However in many cases the data will not contain an issue number and I would like the automation to just ignore this instead of failing with an error.

When the JQL search returns an empty key I get the following error:

Incoming webhook trigger failed to run JQL search:"(key = "") AND (project in (xxxx))" - The issue key '' for field 'key' is invalid.

And the rule fails with Some Errors but I would rather just fail the rule gracefully as this is a known case.

Is there anyway to achieve this and make an empty JQL search in the Webhooks just stop running the rule?

 

Thanks for any assistance.

2 answers

@Bill Sheboy sure hopefully this gives more context:

Heres the rule to find the issue in the webhook pull_request title...

Screenshot 2021-05-12 at 10.03.59.png

And the audit log if no issue is found the key is then empty so it shows with "Some errors"...

Screenshot 2021-05-12 at 10.04.23.png

Yup, that looks like a known issue: https://codebarrel.atlassian.net/browse/AUT-1483

Hmmm... I wonder, if you use the "No issues from the webhook" option, and then later use the same JQL to check the webhookData and populate a Lookup Issues action.  Then you could check if the count is zero and fail gracefully.

Hi, I'm experiencing the same issue with webhooks driven by GitHub events.

I tried to follow up on your suggestion Bill, unfortunately the tasks in my automation require the Issue to be set by the webhook trigger rather than an explicit 'Lookup' later on.

Cheers,

Rich
Screenshot 2022-06-07 074956.png

Hi @Rich Tamblyn -- Welcome to the Atlassian Community!

I recommend posting a new question, with images of your complete rule and audit log details, and link back to this post.  Otherwise only the people who are following this thread will see it to offer suggestions.

Until then...that error is telling you that your Transition Issue component needs an issue to process, and so if your trigger is Incoming webhook, you will need to do something like branch on JQL from the webhook data prior to the transition, or get the data directly from the trigger (as shown above).  For an example of the branch technique:

  • trigger: incoming webhook
  • branch: on some JQL built using data from the webhook to get the issue
    • action: transition issue

 

Kind regards,
Bill

0 votes

Hi @Iain Simpson 

Would you please provide an image of your automation rule and audit log?  That may provide more context for the community to offer ideas.  Thanks!

Best regards,

Bill

Suggest an answer

Log in or Sign up to answer