I am trying to propigate data from parent story to child task when I drag and drop a story requirement to a different sprint folder. Right now the parent data (sprint and release) updates based on father_id (sprint folder), but I want the child data (task) to also get updated. When I attempt to set the value it does not change for the children tasks, but it does work for the story, here is my code:
sub update_req_release_sprint_fields
On Error Resume Next
Dim FatherReq
Dim FatherID
Dim ChildrenTaskList
if Req_Fields.Field("RQ_TYPE_ID").Value = "Story" then
FatherID = Req_Fields.Field("RQ_FATHER_ID").Value
Set FatherReq = TDConnection.ReqFactory.Item(FatherID)
Set ChildrenTaskList = TDConnection.ReqFactory.GetChildrenList(Req_Fields.Field("RQ_REQ_ID").Value)
If (FatherReq.Field("RQ_TYPE_ID") = "Sprint Folder" Then
'Update Story Fields
Req_Fields.Field("RQ_USER_TEMPLATE_58").Value = FatherReq.Field("RQ_USER_TEMPLATE_58") 'RELEASE
Req_Fields.Field("RQ_USER_TEMPLATE_55").Value = FatherReq.Field("RQ_USER_TEMPLATE_55") 'SPRINT
'Loop and Update all Tasks Associated with Parent Story
For each Child in ChildrenTaskList
MsgBox "BEFORE - Child.Field(RQ_USER_TEMPLATE_58) = " & Child.Field("RQ_USER_TEMPLATE_58")
MsgBox "BEFORE - Child.Field(RQ_USER_TEMPLATE_55) = " & Child.Field("RQ_USER_TEMPLATE_55")
Child.Field("RQ_USER_TEMPLATE_58").Value = FatherReq.Field("RQ_USER_TEMPLATE_58") 'RELEASE
Child.Post
Child.Field("RQ_USER_TEMPLATE_55").Value = FatherReq.Field("RQ_USER_TEMPLATE_55") 'SPRINT
Child.Post
Actions.Action("actFilterRefresh").Execute
MsgBox "AFTER - Child.Field(RQ_USER_TEMPLATE_58) = " & Child.Field("RQ_USER_TEMPLATE_58")
MsgBox "AFTER - Child.Field(RQ_USER_TEMPLATE_55) = " & Child.Field("RQ_USER_TEMPLATE_55")
Next
Actions.Action("actFilterRefresh").Execute
End If
Set Father = Nothing
set ChildrenTaskList = Nothing
End If
On Error GoTo 0
end sub