如何使用rest api在zephyr中添加相位以进行循环

时间:2015-10-30 06:30:17

标签: java rest jira-zephyr

我正在尝试使用java rest API在zephyr中为循环添加一个阶段。我已经编写了以下代码。

   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;

我收到了500个internel服务器错误。请帮我解决这个问题

1 个答案:

答案 0 :(得分:0)

您似乎错过了网址中的bulkassign参数。请参阅其余电话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