hi I modify the script
to add the line. manager and the C level manager to the approval chain
how even my organization is large and change continuously and some times some department general manager or in role-based defined resign so when it is going to his role it fine it empty so it will write in the approval stage his role name, not his email or his name
like in the second stage I found $REPORTING_TO$ only without any value
if any way to avoid this by alerting the user and reject his request
my script is I've designed based on the attached file