I found that I was able to use ShellExecute () to start TFS with the required work item loaded.
DECLARE INTEGER ShellExecute ; IN SHELL32.dll ; INTEGER nWinHandle,; STRING cOperation,; STRING cFileName,; STRING cParameters,; STRING cDirectory,; INTEGER nShowWindow ShellExecute(0, 'OPEN', "vstfs:///WorkItemTracking/WorkItem/999999?url=http://mytfsserver:8080/tfs/defaultcollection", '', '', 1)
This sample code is from VFP, but the premise should be the same everywhere.
- Declare a function in Shell32.dll
- Call a function with the appropriate parameters
Here's how to start TFS with a work item from the command line:
START vstfs:///WorkItemTracking/WorkItem/999999?url=http://mytfsserver:8080/tfs/defaultcollection
You can create a batch file and pass the work item number to simplify it.
source share