无法通过 Java API 在 Rally 中更新用户故事

Unable to update user story in Rally via Java API

我在 Rally 中有一个用户故事,其中有一个功能设置为父级。我想通过 Java API 将父工件更新为另一个用户故事。但是我在这样做时收到验证错误,即

Validation error: HierarchicalRequirement.parentArtifact should not be set if HierarchicalRequirement.Parent is set and vice versa

我添加了以下 属性 以包含在 UpdateRequest 中:

JsonObject obj = new JsonObject();
jsonObject.addProperty("Parent", "<Parent User story ref>");
UpdateRequest updateRequest = new UpdateRequest("<Child User story ref>", obj);
UpdateResponse updateResponse = rallyApi.update(updateRequest); 

如何覆盖此验证,有人可以帮忙吗?

一个用户故事不能同时具有项目组合项父级和故事父级。只需将 PortfolioItem 字段设置为 null 即可。您可能还需要确保该新父故事的 PortfolioItem 字段设置正确,以便您的汇总仍按预期工作。

jsonObject.addProperty("PortfolioItem", null);