Forums

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

REST API - JQL not working in wiki(confluence)

Willian Zhou
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!
June 27, 2019

Hi experts,

These days in my company I met an issue.

Background,

We use pocket query to link Rest API in JIRA. We setup basic REST to complete the link.

At beginning, I found the link was failed (It worked prefect before) I don't know the reason, then I search in internet and found I can also use API token to access, then I generated a API token key and put it in the password. 

After that, I tried to link /rest/api/2/search for testing, it works again.

微信图片_20190627135132.png

 

But I found another issue, when I tried to use a JQL link to grab the information, it failed!

For example:

/rest/api/2/search?jql=project=10001

微信图片_20190627135223.png

 

Then I got error message

Cannot connect to this datasource. Please check the log files for more details or contact your administrator.

Type: ConnectionException 
Message: Status code was not 2xx but 400

 

Anyone know what should I do? Is there anything related with permission?

Hope you can help me to fix it, thanks again.

1 answer

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2019

Hi @Willian Zhou ,

You are getting 404 (page not found) because you are trying to connect to an endpoint that does not exist.

In the second screenshot, the Test URL you have configured is:

  • /rest/api/2/search/rest/api/2/search?jql=project=10001

While what you wanted configure in there was:

  • /rest/api/2/search?jql=project=10001

 

Most likely this is just a copy-paste issue.

Please fix the Test URL field to be /rest/api/2/search?jql=project=10001 . Make sure you use email address and API Token to authenticate and confirm this solves the issue.

 

Have a nice weekend.

 

Cheers,
Dario

Willian Zhou
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!
June 30, 2019

Thanks, I may attached the wrong picture. I was getting 400 error message. Now it is fixed, we tuned some permission but can't recall where. Anyway, it's good that issue fixed.

Like Dario B likes this

Suggest an answer

Log in or Sign up to answer