I assume "assign to engineer" is a status in your workflow.
The transition can be setup in the service desk automation settings.
Full explanation can be found here:
I do not think post function will work because the post function will only be activated when the workflow transition happen. You need a trigger event to make the transition. From what I understand you want to make the status transition when a comment is added.
There is a template available to auto transition when comment is added - see attached screen. (service desk server 3.8.1, should be the same on cloud)
Hi Jira Service Desk community, Atlassian is on a mission to unleash the potential of all teams, and we know that tools are just one piece of that puzzle. With Jira Service Desk, we have productiv...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events