Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

jira software webhook not fired

Dominik November 16, 2016

Jira: 7.1.9

My Goal: WebHook to ScriptRunner REST Endpoint

I've created a WebHook to RequestBin but it doesn't work

In the Log file (host/plugins/servlet/gantt/get/logfile) aren't any entrys at the time I do an event

which should fire the web hook

image2016-11-16 15:23:39.png

 

But there is also another web hook registered (not by myself) and they told me

that there webhook works

 

I also tried to use other events, but without any success

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2016

It needs to accept a POST request. In your original question you demonstrated that you had written an endpoint for GET.

Example:

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response

@BaseScript CustomEndpointDelegate delegate

doSomething(httpMethod: "POST") { MultivaluedMap queryParams, String body ->
    log.warn ("web hook running")
    return Response.ok(new JsonBuilder([abc: 42]).toString()).build();
}

Note, if you use the wrong verb (if not specified it defaults to GET), you will see in your logs:

[atlassian.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Client error - 404 when posting to web hook at

If you configure security you will see:

[atlassian.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Client error - 403 when posting to web hook at

Dominik November 17, 2016

I have changed my REST Endpoint Script to an http post method

But when I do a sprint event nothing happened

 

as i mentioned, I think the problem isn't the script?

 

There a also no error or warn entrys in the log file

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2016

I think the problem is not the script too. Try creating a web hook pointing to https://requestb.in/ and see if that works. If not you should contact Atlassian support.

Dominik November 17, 2016

like in the picture at my question I have done that and it is not working...

But it is really strange, because there is another webhook which is working

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2016

I'm not being funny, but to test this you are creating sprints right?

What JIRA version?

Dominik November 17, 2016

yes smile I can understand your question

here:

image2016-11-18 9:17:10.png

As I told already, I also tried it with any other event

 

JIRA 7.1.9

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2016

Think you should contact Atlassian support. Works fine for me... and using requestbin is a good test.

Dominik November 17, 2016

Thanks for that time you spent on that issue smile

I've already contacted Atlassian support - I will tell the solution

Zhixun Deng May 10, 2017

Hi Dominik,

have you got the solution after contacting the support? Cause I got exactly the same problem as you did, also I couldn't find anything helpful elsewhere. If you already got the solution could you please share it? Thanks very much.

By the way, did you do that for a internship at a seat comfort apartment somewhere? If so that makes me the one going on with your job...

TAGS
AUG Leaders

Atlassian Community Events