0

大家好,我在为 TFS 中的错误编写描述时遇到问题。我可以很好地创建错误,并且可以很好地填充 StackRank、Priority、Iteration 等。但是,当我尝试使用 StringBuilder 将一些行附加到字符串并进行错误描述时,TFS 将无法识别我的任何 AppendLines。就好像我只是在使用 Append。

        StringBuilder descriptionBuilder = new StringBuilder();

        descriptionBuilder.AppendLine(bugWorkitem.Steps);           
        descriptionBuilder.AppendLine("Sales Force Information");          
        descriptionBuilder.AppendLine(bugWorkitem.SFTicketNumber);           
        descriptionBuilder.AppendLine(bugWorkitem.VersionFoundIn);
        descriptionBuilder.AppendLine(bugWorkitem.VersionFixedIn);
        descriptionBuilder.AppendLine(bugWorkitem.SFComments);
        descriptionBuilder.AppendLine(bugWorkitem.ContactName);
        descriptionBuilder.AppendLine(bugWorkitem.SalesforceModified);            
        descriptionBuilder.AppendLine(bugWorkitem.LastModifiedBy);
        descriptionBuilder.AppendLine(bugWorkitem.SFProject);

        workItem.Fields["Repro Steps"].Value = descriptionBuilder.ToString();

如果我调试此代码 descriptionBuilder.ToString() 显示为有回车符,所以我认为它与 TFS 如何格式化描述有关。如何获得包含回车的描述?

谢谢!

4

1 回答 1

0

Ok, I figured it out. Even though I am using append line once the string is put into the TFS Bug Description(Or also called Steps) it surrounds the entire string with <(p)> html which of course puts it all on one line.

To fix this I just added more appends to put <(p)> around each of my desired lines.

于 2013-07-10T12:42:30.190 回答