Reputation: 1815
I am currently making an addon in outlook and I want to make it so that a work item opens up with the specified template (bug/task/etc) and populates some fields. I cannot figure out how to call the UI though. (This would be something like when you are in excel and importing into TFS and your item doesn't validate so it opens the workitem in a UI)
The namespace or code would be much appreciated.
Upvotes: 2
Views: 1272
Reputation: 65722
The solution for me to see the hidden "Copy Template URL" button was in the URL I used:
http://tfsportal.com/CompanyName/ProjectName/_layouts/tswa/UI/Pages/WorkItems/WorkItemEdit.aspx <- doesn't show the button.
http://tfs.CompanyNameURL:8080/tfs/web/wi.aspx? <- does show the button
Then once you get the URL you can easily Shell the process in .Net. eg:
string URL = the TFSWorkItemURLYouGotFromThewi.aspxPageWithQueryStrings
Process.Start(URL):
Just a FYI: The alternative is to use an instance of the Process class. This allows much more control over the process including scheduling, the type of the window it will run in and, most usefully for me, the ability to wait for the process to finish.
Process process = new Process();
// Configure the process using the StartInfo properties.
process.StartInfo.FileName = "process.exe";
process.StartInfo.Arguments = "-n";
process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
process.Start();
process.WaitForExit();// Waits here for the process to exit.
Upvotes: 2