def addBehaviorToRule(parentRule,behavior,ruleName):
    """
    Function to fetch all childrules of given parentRule

    Parameters
    ----------
    parentRule : <List>
        Default parent rule represented as a list

    behavior: <Dictionary>
        Details of behavior to be updated

    Returns
    -------
    parentRule : Updated Rule tree
    """
    for eachRule in parentRule:
        if eachRule['name'] == ruleName:
            eachRule['behaviors'].append(behavior)
        #Check whether we have child rules, where in again behavior might be found
        if len(eachRule['children']) != 0:
            addBehaviorToRule(eachRule['children'],behavior,ruleName)
        else:
            return parentRule    

    #Awesome, we are done updating behaviors, lets go back
    return parentRule