Does Script Runner work with Webhooks

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")

1 answer

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.


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.


@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.

How long does the long-running query take? In the most recent version there is a profiler thingy - - 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.


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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

441 views 8 26
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you