1

I am able to add a single test case result using the /testcaseresult/create API and passing the JSON as:

 {
    "testcaseresult":
    {
        "Build":5,
        "Date":"2017-02-27T18:03:29.260Z",
        "Testcase":{"_ref":"https://rally1.rallydev.com/slm/webservice/v2.0/TestCase/12345678"},
        "Verdict":"Pass"
    }
 }

Is there a way to add multiple test case results?

akshay1188
  • 1,647
  • 2
  • 17
  • 35
  • 1
    You can add multiple test case results to the same testcase in one request. There's also a batch endpoint which you can create multiple items in one request. Which rest toolkit are you using to integrate with wsapi? – Kyle Morse Feb 28 '17 at 19:02
  • I am working with Swift and so not able to use any toolkits. I am looking at the documentation for the WSAPI and trying to figure out from there. Can you link me to the batch endpoint? – akshay1188 Feb 28 '17 at 19:06
  • I am planning to add test case results to different test cases at once. One result per test case. Is that possible? – akshay1188 Feb 28 '17 at 19:07
  • 1
    You'll want to use the batch endpoint. There is unfortunately not a nice page in the wsapi docs for it yet, but it's widely used across the product so is safe to use. I'll write an example request format as an answer to this question shortly... – Kyle Morse Feb 28 '17 at 19:22

1 Answers1

2

You can use the wsapi batch endpoint to create multiple items at the same time:

post url: https://rally1.rallydev.com/slm/webservice/v2.0/batch

post body:

{
    "Batch": [
        {
            "Entry": {
                "Path": "/testcaseresult/create",
                "Method": "POST",
                "Body": {
                    "testcaseresult": {
                        "Build":5,
                        "Date":"2017-02-27T18:03:29.260Z",
                        "Testcase": "/TestCase/12345678",
                        "Verdict":"Pass"
                     }
                }
            }
        },
        {
            "Entry": {
                "Path": "/testcaseresult/create",
                "Method": "POST",
                "Body": {
                    "testcaseresult": {
                        "Build":5,
                        "Date":"2017-02-27T18:03:29.260Z",
                        "Testcase": "/TestCase/1234",
                        "Verdict":"Fail"
                     }
                }
            }
        }
    ]
} 
Kyle Morse
  • 8,390
  • 2
  • 15
  • 16