作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我之前问过如何创建“UserStory
”并将其与 RallyApi 中的“Feature
”相关联 here.
现在,我要问如何创建一个EpicStory
。然后,创建一个 UserStory
并将其关联到 EpicStory
。
下面,我在出现错误的地方做了标记。我不知道要设置什么参数。错误是:“无法为投资组合项设置值:无法在属性投资组合项中使用类型 UserStory”
这是我目前所拥有的:
// Initialize the REST API. You can specify a web service version if needed in the constructor.
RallyRestApi restApi = GetRallyRestApi();
// Create their Json object for this Feature
DynamicJsonObject toCreate = new DynamicJsonObject();
toCreate["Name"] = FeatureToAdd.Name;
toCreate["Description"] = FeatureToAdd.Description;
// create feature - (feature is under PortfolioItem)
CreateResult createFeatureResult = restApi.Create("PortfolioItem/Feature", toCreate);
// add Epic Stories
foreach (EpicStory e in FeatureToAdd.EpicStories)
{
toCreate = new DynamicJsonObject();
toCreate["Name"] = e.Name;
toCreate["Description"] = e.Description;
toCreate["PortfolioItem"] = Ref.GetRelativeRef(createFeatureResult.Reference);
// hierarchicalrequirement = UserStory
CreateResult createEpicStoryResult = restApi.Create("hierarchicalrequirement", toCreate);
// foreach userstory create the USerStory and each subsequent Task
foreach (UserStory u in e.UserStories)
{
toCreate = new DynamicJsonObject();
toCreate["Name"] = u.Name;
toCreate["Description"] = u.Description;
toCreate["PortfolioItem"] = Ref.GetRelativeRef(createEpicStoryResult.Reference); //<-This is the problem; says "Could not set value for Portfolio Item: Cannot use type UserStory in attribute Portfolio Item"
// hierarchicalrequirement = UserStory
CreateResult createUserStoryResult = restApi.Create("hierarchicalrequirement", toCreate);
// -- add tasks for each UserStory
foreach (eBayData.Models.Task t in u.Tasks)
{
toCreate = new DynamicJsonObject();
toCreate["Name"] = t.Name;
toCreate["Description"] = t.Description;
toCreate["WorkProduct"] = Ref.GetRelativeRef(createUserStoryResult.Reference);
// task
CreateResult createUserStoryTaskResult = restApi.Create("task", toCreate);
}
}
}
最佳答案
通过查看 API 和 Rally UI,我认为您需要将问题行从 toCreate["PortfolioItem"]
更改为 toCreate["Parent"]
.
关于c# - 拉力赛API : How to create UserStory and relate it to an EpicStory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34161382/
我是一名优秀的程序员,十分优秀!