1

I have been trying and searching hard to add a new comment for a defect using C# and OTA API, but not able to achieve anyhow. Bug is having summary, id.. etc properties but no Comment property. I tried like this:

private void UpdateComment(string DefectID)
{
    string desc = "";
    BugFactory bugFac = (BugFactory)pdl_qc.BugFactory;
    TDFilter filter = (TDFilter)(bugFac.Filter);
    filter["BG_BUG_ID"] = DefectID;
    List def = bugFac.NewList(filter.Text);
    string bugComment;
    foreach (Bug bug in def)  // I know this also I need to modify
    {
        desc = bug.Summary.ToString(); // Here I get the summary for the Defect ID
        bugComment = bug["BG_DEV_COMMENTS"]; // but this return some xml format
    }
    string newComment = "Investigating further" // something like this
    //Now I want to update this new comment for DefectID

}

Please help on how to add a new comment for a bug number.

Thanks in advance !

AppDev_Mon
  • 11
  • 3

1 Answers1

1

Comment fields in QC are fields for which the actual value is stored in an html format / html document.

To add a comment, you need to insert your next text before the tag closing the html document.

You should use standard html to format your comment.

Alex Shnayder
  • 1,362
  • 1
  • 13
  • 24
  • Thanks @Alex Shnayder. That means I need to process the variable that contains complete html tags and add my comments with all other tags(formatter). – AppDev_Mon Feb 10 '14 at 06:51