So I delegated this internally too and we have a solution:
We're adding the runid to a custom usersetting at the time the user clicks the add defect button (via ActionCanExecute). Then using this ID in BugNew to get the data via a RunFactory and a TestFactory.
If anyone else ever has this issue - that's one solution that works [img]/images/graemlins/smile.gif[/img]
If I understand your query I found that if I showed the dialog box name and the module it was sourced from all defects raised from the Test Lab dont go through Bug_New, they go through Bug_FieldChange.
You need to do the following:
If ActiveModule = "TestLab" Then
...add all you field conditions ...
When you are adding fields from the run you need to do it like this:
Bug_Fields("BG_USER_03").Value = TestSetTest_Fields("TS_USER_05").Value
For this particular project we tracked down all the different ways you could raise a defect and stopped them all, except for the ones raised from a test in test lab from an instance or a run. This helps because all defects have an immediate paths for investigation.
While I have been working for Businesses that are Vendor partners with HP, IBM and Microsoft, my opinions and advice is my own.
The solutions provided are either sourced from my own scripting libraries or from a quick Google Search.