1

I am trying to add a phase to the cycle in zephyr using java rest API.i have written the following code.

   String auth = new String(Base64.encode("test.manager:test.manager"));
    Client client= Client.create();
    WebResource webresource = null;
    ClientResponse response=null;
    String responseData=null;


String cyclephase ="{\"remoteRepository\": {\"remoteData\": {\"id\":\"10\",\"name\": \"phase10\"}  },\"startDate\": \"1447957800000\",  \"endDate\": \"1448389800000}\"}";  
    webresource = client.resource("http://localhost:81/flex/services/rest/latest/cycle/7/cyclePhase/");
    response= webresource.header("Authorization", "Basic " + auth).type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class,cyclephase);
    responseData =response.getEntity(String.class); 
    return responseData;

I am getting 500 internel server error.please help me on this

1 Answers1

0

It seems you are missing the bulkassign parameter from the url . Please refer to the rest call POST:

POSThttp://localhost:80/flex/services/rest/latest/cycle/id/cyclePhase?bulkassign=bulkassign on http://docs.zee.apiary.io/#reference/cycle/add-cyclephase-to-cycle/add-cyclephase-to-cycle
Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102