What if the test-in-TestSet is linked to more than one defect?
What if the defect is linked to the test?
What if the defect is linked to the TestSet?
What if the defect is linked to a Run?
What if the defect is linked to a Run Step?
What's wrong with using the features in the UI - 'Linked Defects' tab >> option: All Links
I have tried something similar once on user's request (was reporting straight off Execution Grid), so I might add you would need also to
- figure out, when the code should be triggered, e.g. actions like "actAddNew/ExistingDefect" (not easy)
- use the BugLinkFactory off whatever it is that you want to have the links of (difficulty depends on which links you want to have)
- come up with some concatenation rule (e.g.: ID1; ID2 ;ID3) for the references (easy)
- sort on IDs for looks (easy)
- ensure that users cannot change the field manually (easy)
- understand that changes by one user won't be reflected in cached content another user sees (I think "linked Defects" is always being reloaded when selected)
I would say that DB triggers would probably be ideal for this (you're just changing content in a user defined field), but you'd still have the caching issue. I have never done any DB triggers, but some people love them.
It makes the 'Linked Defects' tab look even more interesting, doesn't it ? [img]/images/graemlins/wink.gif[/img]