Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to access JIRA via REST API

Kalyan Raj Sista October 24, 2018

Within Jenkins, I have configured JIRA Issue updater plugin. I have configured credentials (JIRA username and password) in the job along with the REST base URL as https://some-company/rest/api/latest. I am getting the following error..

Unable to connect to REST service
java.io.IOException: Server returned HTTP response code: 401 for URL: https://some-company.atlassian.net/rest/api/latest/search?jqlFinished: SUCCESS

 

Do I need to use any other authentication mechanism to access JIRA via Jenkins? any inputs are appreciated.

4 answers

0 votes
Kalyan Raj Sista November 1, 2018

I have generated an API token and used REST API. It just worked fine for me.

0 votes
Arun_Thundyill_Saseendran
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.
October 24, 2018

Hi @Kalyan Raj Sista

You are getting back a 401, which means that JIRA is able to get it and is saying that the user is not authenticated.

So as mentioned by @Thomas Deiler, the first step would be to make use of a ReST client like Postman and test of the call to the endpoint is working good. Ideally you could make use of Basic Auth and Postman will help you do it.

Second, trace the call from Jenkins and compare the auth type and auth itself that Jenkins sends and check if there is any mismatch. It can many a time be a Jenkins Plugin error or even a stray character getting into the credentials. So once you get the request headers, do a base64 decode (if Basic Auth is used) and check the credentials are right.

Once you are done with these two steps, you would get a fair idea of what's going wrong.

 

Kindly get back with the results of the above two steps.

Do let me know if you need any help of these.

 

Thanks

Arun

0 votes
Arun Thundyill Saseendran
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!
October 24, 2018

....

0 votes
Thomas Deiler
Community Champion
October 24, 2018

Dear @Kalyan Raj Sista,

best you start with a REST Client (eg. browser extension) to figure out if it works at all. Please report back if there is some progress.

So long

Thomas

Suggest an answer

Log in or Sign up to answer