def METHOD_NAME(resultFile, all_projects):
    log = {}
    log['totalCount'] = len(all_projects)
    log['updatedProjectsWithobligationList'] = []
    oblList = {}
    obligationStatusInfo = {}
    obligationStatusInfos = {}
    for project in all_projects:
        linkedOblId = project.get("linkedObligationId")
        todos = project.get("todos")
        if len(todos) > 0:
            if linkedOblId is None:
                oblList["type"] = 'obligationList'
                oblList["projectId"] = project.get("_id")
                for todo in todos:
                    todotext = getOblTextNLevel(todo.get("todoId")).get("oblText")
                    obligationLevel = getOblTextNLevel(todo.get("todoId")).get("oblLevel")
                    obligationStatusInfo["obligationLevel"] = obligationLevel
                    obligationStatusInfo["text"] = todotext
                    obligationStatusInfo["status"] = 'FULFILLED' if todo.get("fulfilled") == True else 'OPEN'
                    todocomment = todo.get("comments")
                    obligationStatusInfo["comment"] = todocomment if todocomment is not None else ""
                    obligationStatusInfo["modifiedOn"] = getDateOnly(todo.get("updated")) if todo.get("updated") != "" else ""
                    obligationStatusInfo["modifiedBy"] = getEmailFromUserId(todo.get("userId"))
                    obligationStatusInfos[todotext] = {}
                    obligationStatusInfos[todotext] = obligationStatusInfo
                oblList["linkedObligationStatus"] = obligationStatusInfos
                updatedProjectsWithobligationList = {}
                updatedProjectsWithobligationList['id'] = project.get('_id')
                log['updatedProjectsWithobligationList'].append(updatedProjectsWithobligationList)
                if not DRY_RUN:
                    doc_id, doc_rev = db.save(oblList)
                    project["linkedObligationId"] = doc_id
                    db.save(project)
            else:
                obligList = getLinkedObligationList(project.get("linkedObligationId"))
                for todo in todos:
                    todotext = getOblTextNLevel(todo.get("todoId")).get("oblText")
                    obligationStatusInfo["text"] = todotext
                    obligationLevel = getOblTextNLevel(todo.get("todoId")).get("oblLevel")
                    obligationStatusInfo["obligationLevel"] = obligationLevel
                    obligationStatusInfo["status"] = 'FULFILLED' if todo.get("fulfilled") == True else 'OPEN'
                    todocomment = todo.get("comments")
                    obligationStatusInfo["comment"] = todocomment if todocomment is not None else ""
                    obligationStatusInfo["modifiedOn"] = getDateOnly(todo.get("updated")) if todo.get("updated") != "" else ""
                    obligationStatusInfo["modifiedBy"] = getEmailFromUserId(todo.get("userId"))
                    obligationStatusInfos[todotext] = {}
                    obligationStatusInfos[todotext] = obligationStatusInfo
                    exstingOblStatusInfo = obligList.get("linkedObligationStatus")
                    obligationStatusInfos.update(exstingOblStatusInfo)
                obligList["linkedObligationStatus"] = obligationStatusInfos
                updatedProjectsWithobligationList = {}
                updatedProjectsWithobligationList['id'] = project.get('_id')
                log['updatedProjectsWithobligationList'].append(updatedProjectsWithobligationList)
                if not DRY_RUN:
                    doc_id, doc_rev = db.save(obligList)
    json.dump(log, resultFile, indent = 4)