3
votes

I am trying to create a test case result using a REST client, but get this error:

"Errors": ["Cannot parse input stream due to I/O error as JSON document: Parse error: expected '{' but saw '\uFFFF' [ chars read = >>>\uFFFF<<< ]"]
1

1 Answers

2
votes

I get the same error when the name of the object, testcaseresult is not specified in the request body. Here are the steps to create a test case result using a browser REST client:

a) Generate the authorize key using "GET" method and the following URL:

https://rally1.rallydev.com/slm/webservice/v2.0/security/authorize

This is the response that I get back, with the security token: "123abc..."

{"OperationResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": [], "Warnings": [], "SecurityToken": "abc123..."}}

b) Use "POST" method, and the following URL:

https://rally1.rallydev.com/slm/webservice/v2.0/testcaseresult/create?key=abc123...

notice the security token in the end.

c) here is an example of a request body:

{
"testcaseresult":
{
"Build":"1",
"Tester":"/user/777",
"Date":"2010-09-04T19:56:05.000Z",
"TestCase":"/testcase/1111",
"Verdict":"Pass"
}
}

Only the required fields and the fields you want to set need to be referenced. Notice the outer key/value pair

{
"testcaseresult":{}
}

The fields that point to a full object, like "Tester" (points to User object) and "TestCase" (points to a TestCase object that owns the result) have to be referenced by their ObjectIDs:

"Tester":"/user/777",
"TestCase":"/testcase/1111",