Trying to add a new item as closed.
Posted: Thu Jan 15, 2009 1:41 pm
I am trying to write an import util to take our work item list and import it into Fortress. I believe that my technique is correct but for some reason even though I have the status marked as "Closed", when I look at it in Fortress it shows as open. I did create a custom status for "Closed".
Here is my code sample...
ServerOperations.client.LoginOptions.URL = textBox1.Text;
ServerOperations.client.LoginOptions.User = textBox2.Text;
ServerOperations.client.LoginOptions.Password = textBox3.Text;
ServerOperations.Login();
foreach (DataRow row in issuelisttempDataSet.Table_1.Rows)
{
FortressItemExpanded fie = new FortressItemExpanded();
fie.ProjectName = "t1";
fie.Description = row[5].ToString();
fie.Details = "Imported from Issue List Doc:\r\n" +
"Issue #:\t " + row[1].ToString() + "\r\n" +
"Date Open:\t " + row[2].ToString() + "\r\n" +
"Fixed In:\t " + row[3].ToString() + "\r\n" +
"Application:\t " + row[4].ToString() + "\r\n" +
"Description:\r\n\t " + row[5].ToString() + "\r\n\r\n" +
"Resolution Notes:\r\n\t " + row[6].ToString() + "\r\n" +
"Build:\t " + row[7].ToString() + "\r\n" +
"Rel Date:\t " + row[8].ToString() + "\r\n";
fie.Status = "Closed";
fie.ItemType = "Bug";
fie.Priority = "Unknown";
fie.TimeEstimate = "Unknown";
fie.Platform = "Windows";
fie.Category = "";
fie.VersionStr = "";
fie.Custom1 = "Import";
fie.Custom2 = row[7].ToString();
fie.throwExceptions = true;
fie.Validate();
try
{
ItemTrackingOperations.ProcessCommandAddFortressItem(fie);
}
catch (Exception ex)
{
}
I would appreciate if anyone had an idea as to why I can't set the status via code.
Also, I don't see a property for marking an item as public or private.
Here is my code sample...
ServerOperations.client.LoginOptions.URL = textBox1.Text;
ServerOperations.client.LoginOptions.User = textBox2.Text;
ServerOperations.client.LoginOptions.Password = textBox3.Text;
ServerOperations.Login();
foreach (DataRow row in issuelisttempDataSet.Table_1.Rows)
{
FortressItemExpanded fie = new FortressItemExpanded();
fie.ProjectName = "t1";
fie.Description = row[5].ToString();
fie.Details = "Imported from Issue List Doc:\r\n" +
"Issue #:\t " + row[1].ToString() + "\r\n" +
"Date Open:\t " + row[2].ToString() + "\r\n" +
"Fixed In:\t " + row[3].ToString() + "\r\n" +
"Application:\t " + row[4].ToString() + "\r\n" +
"Description:\r\n\t " + row[5].ToString() + "\r\n\r\n" +
"Resolution Notes:\r\n\t " + row[6].ToString() + "\r\n" +
"Build:\t " + row[7].ToString() + "\r\n" +
"Rel Date:\t " + row[8].ToString() + "\r\n";
fie.Status = "Closed";
fie.ItemType = "Bug";
fie.Priority = "Unknown";
fie.TimeEstimate = "Unknown";
fie.Platform = "Windows";
fie.Category = "";
fie.VersionStr = "";
fie.Custom1 = "Import";
fie.Custom2 = row[7].ToString();
fie.throwExceptions = true;
fie.Validate();
try
{
ItemTrackingOperations.ProcessCommandAddFortressItem(fie);
}
catch (Exception ex)
{
}
I would appreciate if anyone had an idea as to why I can't set the status via code.
Also, I don't see a property for marking an item as public or private.