我无法创建缺陷并与用户故事相关联。我正在使用下面的拉力赛api java代码

时间:2013-03-19 06:11:20

标签: rally

我无法创建缺陷并与用户故事相关联。我正在使用下面的拉力赛api java代码。

JsonObject newDefect = new JsonObject();

newDefect.addProperty("Name", "defect added to check");
newDefect.addProperty("Description", "description added to check");
newDefect.addProperty("Requirement", "/userstory/11018012245");
newDefect.addProperty("SubmittedBy", "user/10832575945");
newDefect.addProperty("Workspace", "/workspace/10832575967");
newDefect.addProperty("Project", "project/10832575978");

CreateRequest createRequest = new CreateRequest("defect", newDefect);
CreateResponse createResponse = restApi.create(createRequest);createResponse.getObject().get("FormattedID").toString();

1 个答案:

答案 0 :(得分:1)

你的代码看起来不错,看起来你的几个参考文件中只有一些缺少“/”:

newDefect.addProperty("SubmittedBy", "user/10832575945");

- >

newDefect.addProperty("SubmittedBy", "/user/10832575945");

newDefect.addProperty("Project", "project/10832575978");

- >

newDefect.addProperty("Project", "/project/10832575978");