I have added a field to my test cases so I can add a custom test case number to each test. It is automatically generated with some workflow code. It works fine except for the following scenario:
If users are creating a series of test cases, they will sometimes copy and paste an existing test case. When they do this, the test case number is copied as well, defeating my unique numbering. I tried adding the following, but this doesn't seem to be triggered in this scenario:
That code will only be triggered on the pressing of the new test icon, which isn't part of copying.
About the only thing I can see without a major undertaking of comparing numbers in that field at a database trigger level is to either disable the copying ability of a test case (which I am sure will cause an outcry from your user base), or enforce training.
Insanity: doing the same thing over and over again and expecting different results