java拉力赛api,无法在特定的迭代和发布中创建测试集,在非计划的迭代中创建

时间:2017-06-02 09:53:54

标签: rally

JsonObject newTS = new JsonObject();
newTS.addProperty("Workspace", "/workspace/25194919975");
newTS.addProperty("Name", "name");
newTS.addProperty("Project", "/project/81223493876");
newTS.addProperty("Tags", tagName);
newTS.addProperty("Release.Name", releaseID);
newTS.addProperty("Iteration.Name", iterationID);
newTS.addProperty("projectScopeUp", false);
newTS.addProperty("projectScopeDown", true);
newTS.addProperty("fetch", true);
newTS.addProperty("rankTo", "BOTTOM");
newTS.add("TestCases", testCaseList);

CreateRequest createRequest = new CreateRequest("testset",newTS) 
CreateResponse createResponse = restApi.create(createRequest);

结果:

{"CreateResult": { "_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": [], "Warnings": ["It is no longer necessary to append \".js\" to WSAPI resources.", "Ignored JSON element testset.Tags.Name during processing of this request.", "Ignored JSON element testset.Release.Name during processing of this request.", "Ignored JSON element testset.Iteration.Name during processing of this request.", "Ignored JSON element testset.projectScopeUp during processing of this request.", "Ignored JSON element testset.projectScopeDown during processing of this request.", "Ignored JSON element testset.fetch during processing of this request.", "Ignored JSON element testset.rankTo during processing of this request."]

1 个答案:

答案 0 :(得分:0)

当然,您只需要通过对象引用而不是按名称设置迭代和释放 - 就像使用Project一样。

newTS.addProperty("Iteration", "/iteration/12345");
newTS.addProperty("Release", "/release/23456");

其他一些事情:

设置projectScopeUpprojectScopeDown对创建无效。

应在请求中设置

fetch

createRequest.setFetch(new Fetch("true"));
应该在请求中添加

rankTo作为参数:

createRequest.addParam("rankTo", "Bottom");