<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_action_to_ancestors(analysis_request, transition_id):
 """Promotes the transitiion passed in to ancestors, if any """

    parent_ar = analysis_request.getParentAnalysisRequest()
    if parent_ar:
        do_action_for(parent_ar, transition_id)