Setting headers in the POST callback of a Webhook

laramarinha April 8, 2016

I am trying to trigger a build of a Jenkins job through a JIRA webhook. But I am getting a 403 error, which mean it is missing the authentication token in the POST request. Is there any way to set headers in the webhook URL?

2 answers

0 votes
laramarinha April 10, 2016

Hi,

Thank you for the reply. But how can I set that header in JIRA? Because it is only possible to set the URL in the webhook configurations. 

Richard Clarke March 11, 2020

I agree on Jira Cloud, we need a definitive answer from Jira.

as of 11-03-2020 this is STILL not possible!  why?......

0 votes
Aleks Yenin (Polontech)
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.
April 8, 2016

Hello Lara,

Here is the needed headers

:
BASE64Encoder base=new BASE64Encoder();
String encoding = base.encode ("username:password".getBytes());
postRequest.setHeader("Authorization", "Basic " + encoding);
postRequest.setHeader("X-Atlassian-Token","nocheck"); 

Suggest an answer

Log in or Sign up to answer