我正在尝试在Rally中获取给定用户故事的附件数量。 我怎样才能以编程方式实现这一目标。
public void getAttachmentCount(string workspaceRef, string projectRef)
{
//Authenticate
this.EnsureRallyIsAuthenticated();
//setup the userStoryRequest
Request userStoryRequest = new Request("Attachments");
userStoryRequest.Workspace = workspaceRef;
userStoryRequest.Project = projectRef;
//fetch data from the story request
userStoryRequest.Fetch = new List<string>()
{
"Attachments"
};
}
答案 0 :(得分:0)
这将为您提供使用FormattedID找到的特定用户素材的附件计数。
Request userStoryRequest = new Request("HierarchicalRequirement");
userStoryRequest.Workspace = workspaceRef;
userStoryRequest.Project = projectRef;
userStoryRequest.Query = new Query("FormattedID", Query.Operator.Equals, "US1");
userStoryRequest.Fetch = new List<string>(){"Attachments"};
QueryResult userStoryResult = restApi.Query(userStoryRequest);
foreach(var result in userStoryResult.Results)
{
Console.WriteLine("Attachment Count: " + result["Attachments"].Count);
}
您还需要传入或了解相关用户素材(分层要求)的FormattedID。