Forums

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

REST API status 200 OK, saying not authorized, but I can edit directly on Jira website

Vincent Wang April 8, 2019

Tried to use REST API to edit a test case in Postman, always return Status 200 OK, with Body as below. I've tried with the same credential in Jira website, and I can edit the test case directly there.

...

<input type="hidden" title="loggedInUser" value="Vincent.Wang">

<input type="hidden" title="ajaxTimeout" value="The call to the Jira server did not complete within the timeout period. We are unsure of the result of this operation.">

<input type="hidden" title="JiraVersion" value="7.11.0" />
<input type="hidden" title="ajaxUnauthorised" value="You are not authorized to perform this operation. Please log in.">

<input type="hidden" title="baseURL" value="https://mycompanyJira.net" />
<input type="hidden" title="ajaxCommsError" value="The Jira server could not be contacted. This may be a temporary glitch or the server may be down. ">
<input type="hidden" title="ajaxServerError" value="The Jira server was contacted but has returned an error response. We are unsure of the result of this operation."> 

...

settings in Postman:

PUT 'http://mycompnayJira:8080/secure/Tests.jspa#/design?projectId=10203/rest/atm/1.0/testcase/VAL-T001'

Header: Basic Auth with my credential, Content-Type: application/json

Body: 

{
"testScript": {
"type": "STEP_BY_STEP",
"steps": [
{
"description": "description",
"testData": "td: 10",
"expectedResult": "Ensure xxxx."
}
]
}
}

 

Regards Vincent

1 answer

1 accepted

1 vote
Answer accepted
Vincent Wang April 9, 2019

Finally I found the wrong address caused this issue.

Instead of using 'http://mycompnayJira:8080/secure/Tests.jspa#/design?projectId=10203/rest/atm/1.0/testcase/VAL-T001' to PUT/POST/GET, I got it worked with 'http://mycompnayJira:8080/rest/atm/1.0/testcase/VAL-T001'.

Another finding is that both Status 200 and Status 201 indicate the REST API command works for me.

I sent GET command to get the test case information, and the response is 'status 200 OK' with correct TC info.

Then I sent POST command to create test results to a test cycle, and the response is 'status 201 Created' with test results id.

New to Jira, just to share this with all other beginners with similar questions.

Suggest an answer

Log in or Sign up to answer