V5 REST API error updating a Test Case via PUT

Friday, January 18, 2019
Avatar

When trying to use the V5 REST API to update a Test Case using the PUT method described on this documentation page, the API throws back an error "The server encountered an error processing the request. The exception message is 'Nullable object must have a value.'. See server logs for more details. The exception stack trace is: etc etc"

The Body of the PUT request I'm sending is {"TestCaseId":79537,"Name":"Updated Name"}. Even if I just send a Body with just the TestCaseId field in it, I get the error.

I've also tried formatting the Body as {"TestCaseId":'79537',"Name":"Updated Name"} and {"TestCaseId":"79537","Name":"Updated Name"} and still get the same error.

Unfortunately, the documentation page doesn't say which of the fields are mandatory, but I'm assuming at least the TestCaseField is required. The documentation also doesn't say what format the fields need to be (numerical / text etc) so I guessing that too.

I'm new to SpiraTeam / SpiraTest, but the REST API documentation seems quite vague and uninformative compared to other platforms with REST  APIs that I use.

4 Replies
Friday, January 18, 2019
Avatar
re: dbakkers Friday, January 18, 2019

Hello,

Normally with our REST API when doing a PUT, you need to first do a GET of the entire JSON object, then make changes to the fields you need and the do a PUT back.

We have concurrency checking and there various fields you need to provide, many of which are mandatory (e.g. Concurrency Date).

Also for these questions, I'd recommend a help desk ticket vs. a forum post if you want specific help for you REST API call.

Regards

Adam

Monday, January 21, 2019
Avatar
re: inflectra.david Friday, January 18, 2019

Thanks Adam

It's a shame that the documentation doesn't tell the reader any of this. If a full GET needs to be done before the PUT, then why not say so in the documentation? If there are 'various fields' that need to be submitted in the PUT, then why not say which ones in the documentation? It sure would beat having to guess all this stuff or work it out via trial and error.

In the future I'll submit these issues via the Help Desk.

 

Monday, January 21, 2019
Avatar
re: dbakkers Sunday, January 20, 2019

You're welcome.

I understand. It is our plan to improve the documentation in such ways in the future.

Regards

Adam

Wednesday, January 30, 2019
Avatar
re: inflectra.david Monday, January 21, 2019

Excellent topic. Thank you for this.

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Friday, January 18, 2019
  • Last Reply: Wednesday, January 30, 2019
  • Replies: 4
  • Views: 5705