Use this post function script to automatically add a specific user as the assignee when a defined workflow transition occurs.
I work in support and when transitioning a workflow from 'in progress' to 'in review', I need my manager to be assigned to this issue so they can review it. This script automatically assigns this issue so I don't have to do this manually every time.
// the username of the assignee
final String userName = "user_name"
def user = ComponentAccessor.userManager.getUserByName(userName)