Target Release & Cycle
Our users would like to enter a defect number in a user field in the requirements module and have the target release and cycle from the defect copied over to the requirement in our install of QC 10. I've tried everything I can think of and am starting to feel like I'm banging my head against a wall.
Here's my latest attempt:
If Req_Fields("RQ_USER_37").value <> "" Then
Set td = TDConnection
Set bgfact = td.BugFactory
set bg = bgfact.Item(Req_Fields("RQ_USER_37").value)
Set listOfCycles = bg.Field("BG_TARGET_RCYC")
Req_Fields("RQ_TARGET_RCYC") = listOfCycles
Set bg = Nothing
Set bgfact = Nothing
RQ_TARGET_RCYC For internal use. Do not write to this field. Integer 4
Yes, you know I saw that.. but then in the OTA Reference they have some code that removes a cycle and writes it back to the field, so I'm thinking sometimes it's okay?
Remove requirement target release cycle
Set listOfCycles = requirement.Field("RQ_TARGET_RCYC")
For indx = listOfCycles.Count To 1 Step -1
Set cyc = listOfCycles.Item(indx)
If (cyc.ID = cycleToRemoveId) Then
'Set the modified list of Releases Cycles.
requirement.Field("RQ_TARGET_RCYC") = listOfCycles <-----------------------
You can write to that field but you need to assign it a release cycle object and QC will take care of the rest. The db expects an integer but the API expects an object.
That's what I thought I was doing, but it doesn't seem to be working for me. I'm starting to think that it doesn't like me pulling the bug release cycle object and trying to put it in the requirement release cycle object. Can anybody confirm this, or think of a possible workaround?
The frustrating thing is that to the user this looks easy -- "Just take it from here, and put it there!"
You still need to use .value to get the rcyc object from the bug field. You probably will then need to create a list and add it to the list and add the list to the requirement field.