gpt4 book ai didi

c# - 拉力赛API : How to create UserStory and relate it to an EpicStory

转载 作者:行者123 更新时间:2023-11-30 23:32:50 29 4
gpt4 key购买 nike

我之前问过如何创建“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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com