如何使用Rally Api和.NET在特定工作区和项目中创建用户素材

rob*_*rdo 3 c# rest web-services rally

好的,我了解如何插入任务并将其与用户故事相关联,但现在我如何插入用户故事并将其与工作空间和项目相关联.这是我到目前为止...

DynamicJsonObject toCreate = new DynamicJsonObject(); 
toCreate["Name"] = "My Test User Story";
toCreate["Description"] = "This is the description of the test User Story";

// these do not exist
//toCreate["Iteration.Name"] = "Iteration Name";
//toCreate["Workspace.ObjectID"] = "123456";
//toCreate["Project.ObjectID"] = "456789";

CreateResult createResult = _restApi.Create("hierarchicalrequirement", toCreate);
bool success = createResult.Success;
Run Code Online (Sandbox Code Playgroud)

rob*_*rdo 5

我试过这个,它有效!

RallyRestApi _restApi = new RallyRestApi("username", "password", "https://rally1.rallydev.com", "1.27");
DynamicJsonObject toCreate = new DynamicJsonObject();
toCreate["Name"] = myUserStory.Name;
toCreate["Description"] = myUserStory.Description;

// these are the important ones..
toCreate["Workspace"] = "/workspace/456879854";
toCreate["Project"] = "/project/4573328835";
toCreate["Iteration"] = "/iteration/4459106059";

CreateResult createResult = _restApi.Create("hierarchicalrequirement", toCreate);            
bool success = createResult.Success;
Run Code Online (Sandbox Code Playgroud)

所以,你必须使用引用.希望这有助于他人!