I have tried setting up a webhook using JQL by Script Runner and the hook never appears to fire. Is this possible to setup? I tried using standard JQL and it worked fine and I tried the Script Runner JQL in the issue browser so I know that both parts work independently but don't work together
I am trying to do the following:
issueFunction in linkedIssuesOf("issuetype = Epic and resolution is empty", "is epic of")
As far as I can see it works, I tested with:
issueFunction in hasSubtasks()
Can you go to one of the issues you think the hook should fire on, let's say the key is JRA-1.
Then try to run the query:
issueFunction in linkedIssuesOf("issuetype = Epic and resolution is empty", "is epic of") and key = JRA-1
Does this return the one issue? If not maybe you have your links the wrong way round.
What events are you listening for?
Hi Jamie,
Thanks for coming back. I have just tested this as you said and I can see that it does find the issue as expected.
The events are just issue created or updated.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you try with the simple query I used?
There is no logging in the relevant class so I can't give you anything to show that that fired or not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamie Echlin [Adaptavist] - I've recently run into this as well and have been playing around with this the last 2 days. I set up a bogus URL so I see the webhook failures in my log file. I easily set up a web hook for both events & on post functions using a regular JQL search. Then I tried setting up a webhook using ScriptRunner JQL functions on a post function. I noticed something peculiar. The original JQL I was using with my webhook was issuetype = 'A' and issueFunction in subtasksOf('issuetype = B and issueFuncion in linkedIssuesOf("issuetype = C and labels = a-label", ALink)'). I double checked to make sure that the issue I tested on matched the JQL. Nothing appeared in the log (neither the expected failed webhook call or a failure in starting the webhook). I tried other randomish ScriptRunner JQL functions with the same result (nothing). Then I tried issuetype = A and issueFunction in hasLinkType("Duplicate") (I tried this because there are very few ~300 matches and it's fairly simple JQL). This fired the webhook. I wonder if this is because of how long the JQL searches take. I'm not sure how to go about testing this though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How long does the long-running query take? In the most recent version there is a profiler thingy - https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_query_profiler - which will show you how long it takes. But, I don't remember see any reference to a timeout when I looked at the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I even artifically made the query take 2 seconds and it still worked.
Can you set the log level to debug for com.atlassian.webhooks , run again, and post the logs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.