Suddenly Getting Error When getting Boards/Sprints/Issues

georgiossalon March 20, 2019

I am using the JIRA REST API for Java.

 

Today all of a sudden I am getting the following error.

 

 

Exception in thread "main" com.mashape.unirest.http.exceptions.UnirestException: java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:143)
at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)

 

This happens always at this part of my code:

HttpResponse response = Unirest.get("https://your-domain.atlassian.net/rest/agile/1.0/board")
  .basicAuth("email@example.com", "")
  .header("Accept", "application/json")
  .asJson();

 

which is taken from the official JIRA website: Jira Software Cloud REST API reference

Of course, the parts of the code above such as the URL, Password and username were replaced accordingly.

 

The code was working perfectly until today 2019.03.20.

2 answers

0 votes
miikhy
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.
March 20, 2019

Hi @georgiossalon ,

You shall reset the CAPTCHA count and account will be enabled for auth through REST API again. This is a security feature made to prevent many kind of attacks including DDoS!

Hope this helps!

Cheers

georgiossalon March 25, 2019

@miikhy  How is it possible to go through these steps concerning the CAPTCHA through the REST API?

miikhy
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.
March 25, 2019

Hi!

Unfortunately I do think you can't reset the CAPTCHA through the API, that being said, there is no CAPTCHA by default, it's enabled after unsuccessful logins so you should not need it too often!

Cheers

PBTesting June 25, 2019

Hi @miikhy 

i am also facing the same issue. What is meant by resetting the captcha count? I did recently got the captcha prompt for my jira login. As it is monitored by admin, i need to tell them the exact issue so this can be taken care in future.

thanks

miikhy
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 25, 2019

Hi @PBTesting ,

Resetting the CAPTCHA means setting to 0 the wrong login count (which triggers the CAPTACHA after 3 wrong logins).

That can be done by a Jira admin on a user profile! You can get more details here:

https://confluence.atlassian.com/doc/configuring-captcha-for-failed-logins-216957808.html

Hope this helps!

Cheers

PBTesting June 25, 2019

@miikhy thanks a lot !!

Like miikhy likes this
0 votes
georgiossalon March 20, 2019

I found out it happens because of the captcha. Is there a way to avoid such things through the code?

Suggest an answer

Log in or Sign up to answer