The last few years I wrote some thousend lines of VBScripts to enhance the possibilities of QC. It makes no sense to provide you with this information if you are not familiar with VBScipt. But I suggest to have a look to the scipts in a new project, you will see only the "empty" subs and functions. Then try the scripts wizards and look where and how the workflow is changed. A possibility is also to check the examples of scripts in the help (however they are not all working...). Then just try to do some simple changes, you will get familiar with scripting quite soon. Marc
I have extensive familiarity with vb scripting, and would not mind seeing some of your code snippets. I am just requesting some code snippets in order to get a "feel", if you will, for the scripting environment in QC.
There are lots of different code snippets available in the Administrator's Guide and/or the API Reference Manual.
There is code for sending email(s) to specific people in specific circumstances. There is code to make the Comments field Read Only. There is code to automatically complete one field based upon the value of another field. And on, and on, and on.
Please be specific in what you want to accomplish using the code, and someone may have an idea as to how to assist you.
I also have some questions regarding vbscripting in the QC workflow. I do understand some fundimental elements and have an idea of what I want done. If there is another place in the forum where I should post this, just let me know.
I'm not sure if it's possible, if it's not that is going to be very dissapointing. I've talked to HP Support, they don't support any customization. Honestly, that's the only part I have questions regarding, the rest of QC/ALM seems pretty straight forward to me, but lacking in some options/features I'd like.
So, essentially, all I want to do is link some system/user fields from the req. module to the testing module so that when I generate tests from the requirements I can move some of the data from the fields over and not have to enter all the information twice.
I know I'm in the right place in the workflow because I put a message box and it pops up when I go to generate the test but I can't get any of the fields to actually sync up. QC does this by default (guessing it's in the compiled code somewhere) when it comes to the "Description" field, but no others.
I'm guessing I'm not initiating the req.objects correctly so that the script picks them up to link them to the test fields.
Here is a snipppet of my code.
On Error Resume Next
Set Req_Fields = TDConnection.Req_Fields
set tFactory = TDConnection.TestFactory
testObj = tFactory.NewList("")
reqList = testObj.GetCoverList
MsgBox "This is Where This Is!"
set Test_Fields.Field("TS_USER_02").Value = Req_Fields.Field("RQ_USER_30").Value
set Test_Fields.Field("TS_DEV_COMMENTS").Value = Req_Fields.Field("RQ_DEV_COMMENTS").Value
set Test_Fields.Field("TS_USER_08").Value = Req_Fields.Field("RQ_USER_04").Value
set Test_Fields.Field("TS_USER_013").Value = Req_Fields.Field("RQ_USER_08").Value
On Error GoTo 0
One problem with your code is that Req_Fields is getting you the list of fields for a requirement, not the information for a specific requirement.
You need to first create variables that point at the specific Requirement and the specific Test where you want to synch the data. In some places in the workflow, the scripts automatically have access to the "current" entity being operated on - i.e. in a Test Plan workflow script, you may have a default object already pointing at the current Test Case entity. Most of the time that kind of default object only points to the entity relevant to your current module - a Requirement or a Test Case or.... So you will probably need to do some code to retrieve one or the other entity.
That's just a quick comment trying to point you in the right direction. If you haven't already, you should also look at the Administrator Guide sections on Workflow Customization. They have lots of examples, and talk about the default object variables I mentioned.
[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
I actually got this to work after I fixed my code. It does seem rather flaky though. It seems to work sometimes and sometimes it does not.
I've experemented with checking-in, checking-out the requirements, tests it just seems really particular for some reason. Perhaps like it's not catching it, I've removed the msgbox I had in the sub as I am certain I'm following the same process now. I'm using QC 11, has anyone else had this issue?
I see that the topic is 5 years old. May be someone is still looking into that.
In general VB Scripting in QC is poorly documented. If I want to do something similar to what Scripting wizard does the only way is to look into what is created by wizard, copy it and modify it which is not always works because there are many dependencies.
These are examples of what I would sometimes need to accomplish:
There is a way to add more tabs in the defect module New and Modify screens. GUI allows to create 4 tabs and when I needed the 5th one I tried to copy the code. It did create some unexpected "side effects".
The scripting GUI exists only for DEFECTS module. I'd like to implement similar workflows for requirements module - like automail sent if some field are changed for some requirement types, its. Again, it is possible to "reingineer" it but there is a risk of unexpected side effects.
Anyone can help? Is there a decent document that would describe the modules, fields, relationships, etc. with code samples?