I am currently working on a C# code to export a Bug Report form HP ALM using OTA.
I am successfully able to fetch the System Fields but am not understanding the way to fetch the User Defined fields.
Below is the code snippet. I have marked the point where I am stuck.
BugFactory bugF;
TDFilter bugFFilter;
List bugL;
bugF = (BugFactory)qctd.BugFactory;
bugFFilter = bugF.Filter;
bugFFilter["BG_STATUS"] = "New Or \"In Dev\" Or \"In Design\"";
bugL = bugFFilter.NewList();
foreach (Bug thisBug in bugL)
{
myData = myData + String.Format("{0} {1}", thisBug.ID, thisBug.Summary) + Environment.NewLine;
writer.WriteLine("<tr>");
string myBugID = String.Format("{0}", thisBug.ID);
writer.WriteLine("<td >\n" + myBugID.ToString() + " </td>\n"); //This Works
string myBugV1Def = **// Stuck!! Need help here** <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
writer.WriteLine("<td >\n" + myBugV1Def.ToString() + " </td>\n");
Writer.WriteLine("</tr>");
}
I've tried adding:
string myBugV1Def = thisBug["BG_USER_TEMPLATE_08"].Value.Name;
and also
string myBugV1Def = thisBug.Field("BG_USER_TEMPLATE_08");
but nothing helps.
Thanks.