How to create a Task belonging to an Iteration using Rally Api and .NET
-
27-10-2019 - |
Pergunta
I am new to the Rally API and just having some trouble creating a Task using the Rally.RestApi library. I need to create a Task (using .NET) and associate it with a User Story (in which the User Story belongs to a certain Iteration).
Do I have to get the User Story first, then add a Task to it? How would I do that?
Thanks.
Solução
All objects in Rally have a unique url called a ref. You just need the story's ref to associate the two:
RallyRestApi restApi = new RallyRestApi("myuser@company.com", "password",
"https://rally1.rallydev.com", "1.27");
DynamicJsonObject newTask = new DynamicJsonObject();
newTask["Name"] = "My New Task";
newTask["WorkProduct"] = "/hierarchicalrequirement/12345"; //your story ref here
CreateResult createResult = restApi.Create("task", newTask);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow