Auto populate field value - Parent Req to Child ?
Does anyone know if QC will automatically populate the value of a field (like Release) in the Child requirement if it is entered in the Parent requirement? I have set up my requirements module to model the Agile process and the Parent requirement is User Story and the child requirements are Story Tasks and Acceptance Criteria. If I select or change the Release field on the Parent Requirement, I want it to automatically change that field on all the Child Requirements too.
Re: Auto populate field value - Parent Req to Child ?
PFB code for changing the value in the child req.:
Sub UpdateValue (reqID, relValue)
Dim req, reqChildren
Set req = TDConnection.ReqFactory.Item (reqID)
req.Field("RQ_TARGET_REL") = relValue
On Error Resume Next : Err.Clear
If Err <> 0 Then
MsgBox "Cannot update status of requirement #" & CStr (reqID) & vbCrLf & Err.Description
On Error GoTo 0
Set req = Nothing
Set reqChildren = TDConnection.ReqFactory.GetChildrenList (reqID)
For Each req in ReqChildren
UpdateValue req.ID, relValue
Set reqChildren = Nothing
On Error Resume Next
If (Req_Fields("RQ_TARGET_REL").FieldName = FieldName) Then
newRelValue = Req_Fields("RQ_TARGET_REL").Value
FatherID = Req_Fields("RQ_REQ_ID").Value
UpdateValue FatherID, newRelValue
Please use the above code and let me know.