Call to API /rest/api/2/reindex/issue returns 404 error

rhochteil April 12, 2019

I am getting an error 404 trying to use the reindex api. Please show me a JAVA example of the call.

POST /rest/api/2/reindex/issue

I have tried with ISSUE_ID from previous query......

jsonStr = "{\"issueId\": \"" + rs.getString("ISSUE_ID") + "\"}";
response = client.jiraConn.Post("/rest/api/latest/reindex/issue", jsonStr.getBytes(), headers);

and

/rest/api/latest/reindex/issue/" + rs.getString("ISSUE_ID")

Both return error 404

But the jira issue id does exist.

4 answers

1 accepted

0 votes
Answer accepted
rhochteil April 14, 2019

I solved my problem.

http://My.Domain/jira/rest/api/latest/reindex/issue?issueId=339331

I forgot to put the /jira in front of the /rest/api/...

Thank you to everyone who tried to help me.

Robin

0 votes
Harshada Gothankar October 3, 2019

Hi,

I am getting 404 for the below API. How do I fix it? I need this API to integrate with Japsersoft tool.


https://arterra.atlassian.net/rest/api/issues/?jql=project%20%3D%20%22CHAR%22%20AND%20component%20%3D%20Order_NotShipped

Thanks in Advance

0 votes
Alexey Matveev
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 13, 2019

Hello,

Try to use:

rest/api/2/reindex/issue

and issueId is a parameter and you send it as the payload. It should be like this

rest/api/2/reindex/issue?issueId=12342

rhochteil April 14, 2019

Hi. Thank you for your response but I am using Java code not the URL line.

I have tried these 4 ways with a continuous 404 result

response = client.jiraConn.Post("/rest/api/2/reindex/issue/issueId:339331", "", headers);
response = client.jiraConn.Post("/rest/api/latest/reindex/issue", "{\"issueId\":\"339331\"}", headers);
response = client.jiraConn.Post("/rest/api/latest/reindex/issue", "{\"issueId\": \"CPQCS-5523\"}", headers);
response = client.jiraConn.Post("/rest/api/2/reindex/issue?issueId=339331", "", headers);

Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 14, 2019

But you will have to tell your connection which server it should connect to. Do you do that somewhere?

rhochteil April 14, 2019

yes

rhochteil April 14, 2019

http://My.Domain/rest/api/latest/reindex/issue?issueId=339331

 

<!DOCTYPE HTML PUBLIC '-//IETF//DTD HTML 2.0//EN'><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL /rest/api/latest/reindex/issue was not found.</p></body></html>

0 votes
Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2019

Hi @rhochteil ,

 

It seems that you missed the host name of the URL, try http://jiradomain.com/rest/...

And replace jiradomain.com with domain and port where your Jira is running.

Suggest an answer

Log in or Sign up to answer