Unable to update user story in Rally via Java API

s4ik4t :

I have an user story in Rally which has a feature set as parent. I want to update the parent artifact via Java API to another user story. However I am getting a validation error while doing so i.e.

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

I added following property to include in the 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); 

How to override this validation, can anyone please help?

Kyle Morse :

A user story cannot have both a portfolio item parent and a story parent at the same time. Just set the PortfolioItem field to null and you should be good to go. You'll also probably want to make sure the PortfolioItem field on that new parent story is set correctly so your rollups still work as expected.

jsonObject.addProperty("PortfolioItem", null);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=71434&siteId=1