You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
I had exactly that problem recently, and i'm ready to share what i've came up with.
1. Create a system task that is reachable from your automation context and make it as hidden as possible, so people won't see it and won't delete it. The ID of that task will be the default one
2. In the JQL rule to extract ticket ids from the payload, use the following `key = {{webhookData.action.substring(0,0).concat("@@").concat(webhookData.pull_request.title).concat("@@").concat(webhookData.pull_request.head.ref).concat("@@DEV-84@@DEV-84").match("@@.*?([a-zA-Z]+-\d+)").first}}`
Here, DEV-84 is the ID of your system ticket that you've just created, replace it with your own system ticket ID. This rule is also able to detect a ticket ID from the branch name as well as from the PR title, the title has a priority.
3. As your first component after the webhook, create an IF condition with JQL rule `key != DEV-84`, which basically stop the execution if the ticket is is the "system" one.
4. Add all your other rules after it
That way, if the ticket is not found in PR or branch, the system one will be used instead. Any operation for the system ticket is gracefully ignored.
@Bill Sheboy sure hopefully this gives more context:
Heres the rule to find the issue in the webhook pull_request title...
And the audit log if no issue is found the key is then empty so it shows with "Some errors"...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.