04-30-2010 02:05 AM
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.
04-30-2010 06:58 AM
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.
Please get back to me.
04-30-2010 07:35 AM
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.
05-04-2010 12:03 AM
Yes, I agrre with ronda. If you have specific topics, a lot of people in this forum will help you. It make no sense to provide you with a lot of code if we don't know what you want to do.
08-31-2010 04:24 AM
im new to QC and would like to know how do i start writing scripts for QC.
i.e can some one please point me to a tutorial on how to make a "hello world" in the QC enviorment.
08-31-2010 04:52 AM
Try it like this:
In Sub Req_MoveTo add the following code:
If User.UserName = "MyAccount" Then
MsgBox "Hello World!"
Each time you move the cursor to a requirement, you will see the message. Please replace "MyAccount" with your account. The if clause is to prevent other users being affected with your code.
01-04-2013 08:08 AM
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.
Sub Test_New On Error Resume Next Dim Req_Fields Set Req_Fields = TDConnection.Req_Fields set tFactory = TDConnection.TestFactory testObj = tFactory.NewList("") reqList = testObj.GetCoverList MsgBox "This is Where This Is!" Move_Required_Fields 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 End Sub
Any help would be greatly appreciated.
01-04-2013 07:02 PM
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.
(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.)
03-20-2013 06:45 AM
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?