0

I am trying create a "cycle" in the zephyr using the zephyr java rest API.I have written the following client code to create cycle.

String auth = new String(Base64.encode("test.manager:test.manager"));
    Client client1 = Client.create();

        String cycle ="{'name': 'Cycle with TCR phase',  'build': '7993',  'environment': 'MyOwnEnv',  'startDate': 1447957800000,  'endDate': 1448389800000,  'status': 0,  'releaseId': 1,  'remotePhases': []}";
        WebResource webresource = client1.resource("http://localhost:81/flex/services/rest/latest/cycle");
        ClientResponse response = webresource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).post(ClientResponse.class, cycle);
        String responseData =response.getEntity(String.class);  
        System.out.println(responseData);

I am getting following error"POST http://localhost:81/flex/services/rest/latest/cycle returned a response status of 500 Internal Server Error".Please let me know what is the mistake in the code or is there any configuration need to be setup in zephyr

1 Answers1

0

Please try to use the POST request along with the parameters for instance :

POSThttp://localhost:80/flex/services/rest/latest/cycle/name=Cycle

with TCR phase and let us know if this issue still persists

Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82