title: Cannot create/update a Rally TestCaseResult with a reference to a specified TestSet
body: <p>With Rally, I need to </p>
  
  <blockquote>
    <p>Update a TestCaseResult with a new TestSet Ref. </p>
    
    <p>OR</p>
    
    <p>Create a new TestCaseResult by copying everything from a previous TestCaseResult and just changing the TestSet Ref.</p>
  </blockquote>
  
  <p>I am trying to do the same through the <a href="http://www.rallydev.com/developer/java-toolkit-rally-rest-api" rel="nofollow">Java REST toolkit from Rally</a>. It uses the JSON REST API internally, it seems.</p>
  
  <p>When I try to do this with CreateRequest or UpdateRequest, I get an error from the API "<strong>Could not set value for Test Set: null</strong>"</p>
  
  <p>Is it not possible to update the TestSet of a TestCaseResult (whether existing or newly created)?</p>
  
  <p>Here's some sample code I am using  (showing create testcaseresult from existing by changing testset).</p>
  
  <pre><code>        //get testcaseresult object
          GetRequest tcrReq = new GetRequest("/testcaseresult/12345.js"); 
          tcrReq.setFetch(new Fetch("FormattedID", "Name"));
          GetResponse tcrResponse = restApi.get(tcrReq);
  
          //update testcaseresult object with new testset
          JsonObject tsRef = new JsonObject();
          tsRef.addProperty("_ref", "https://rally1.rallydev.com/slm/webservice/1.39/testset/1029348.js");
          tcrResponse.getObject().add("TestSet",tsRef);
          tcrResponse.getObject().remove("_ref");
  
          //Create API for new testcaseresult object
          CreateRequest createRequest = new CreateRequest("testcaseresult", tcrResponse.getObject());
          CreateResponse createResponse = restApi.create(createRequest);
          if(createResponse.wasSuccessful()){
              System.out.println(createResponse.getObject());
          }else{
              String[] ss = createResponse.getErrors();
              for(int i=0; i&lt;ss.length; i++){
                  System.out.println(ss[i]);
              }
          }
  </code></pre>
  
  <p>Can you please help to understand whether I am doing something wrong or is this a Rally limitation?</p>