[GROOVY]Webhook Trigger

Maciej Olszewski June 13, 2017

Hello,

I am looking for a way to active webhook via groovy script (it doesn't have to be system webhook, if this would require only link to channel it would be great to :) ). I have found Webhook class but i do'nt know how to use it,

If someone could help me with it please,
Thanks in advance,
Maciej

2 answers

0 votes
Harindra Balanagireddy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 18, 2018

looking for groovy script for webhooks ( we know polling option , if any modifications on github it downloads the code through jenkins with polling option same way like that i want to write groovy script for webhook to download the code if any modification in github)

0 votes
Daniel Yelamos [Adaptavist]
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.
June 14, 2017

Hello Maciej.

Can you tell me what you want to do specifically? There are a lot of ways to work with webhooks in SR, if you tell me what you want to do I might be able to help you.

Cheers!

Dyelamos

Maciej Olszewski June 14, 2017

Hello Daniel,

We are using webhooks for communication with slack, but if webhook is set for "Issue Creation" with particular JQL filter it will check every new issue. If you have a lot of webhooks it can cause lower performance for system in future so i am looking if there is a way to trigger for example particular link webhookwith script.

I hope i made everything clear if not let me know :),

Cheers,
Maciej

Daniel Yelamos [Adaptavist]
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.
June 14, 2017

Hello Maciej.

So what I would personally use, is a custom workflow for the project in which you want your issues to trigger. 

Within that custom workflow, within the onCreate transition I would add an scripted postFunction that triggers your webhook using something like in this example

That way you do not overload your instance, because the action will only trigger at the onCreate stage of only the subset of projects that you are interested in. 

If his doesn't fully help you, let me know.

Cheers!

Dyelamos

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events