Skip Navigation LinksHome Page > Forums > SpiraTeam Forums > SpiraTeam Issues & Qu... > V5 REST API error updatin...
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.
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
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.
You're welcome.
I understand. It is our plan to improve the documentation in such ways in the future.
Excellent topic. Thank you for this.
And if you have any questions, please email or call us at +1 (202) 558-6885