HP QC Workflow Customization: Test Plan Module Script
I am trying to write code for following scenario and unsuccessful so far.
In Test Plan module I have the test case in following folder structure:
FRUIT <- Parent Folder
APPLE <- Sub-Folder 1
RIPE <- Sub-Folder 2
Test Case 01_Test the ripe apple <- Test Case
I have created a new user field for Test module i.e. "Project". Now, with the Test Plan Module Script code in Test_MoveTo, I want to update the "Project" field in the Test Case: "Test Case 01_Test the ripe apple" with the top most parent folder name i.e. "FRUIT".
With the information there you will be able to get the full path of your test. You'll then need to remove "Subject\" from the front and isolate your 'top most parent folder'with a bit of string manipulation.
I suggest you look for another trigger to do the update, doing updates within MoveTo is bad practice. For new test cases you could default the value as required, for existing test cases it might be better to run a task occasionally that does the clean up or capture the actions that run when you copy and paste or move a test. By placing your code in MoveTo any existing tests you have won't get updated until someone looks at them. Additionally, if the person who looks at the test only has viewer access the update won't occur.