Getting the latest user task happened in a process

Hi all,
In a process with multiple lanes/ users, we have throw/ catch links that end to a service task that sends a mail message to admins that something went wrong.
In this message, at 5.9x, we added the username of the latest Task that had been executed from the list:

At 7.5 how can we do that?

Functions like
apiAccessor.getProcessAPI().getLastStateHumanTaskInstance() require the taskName, which in our case, it is not know.

thanks in advance.

Get contract contents in a groovy script connector

Is it possible to get the contents of a contract in a groovy script? I created in my pool a contract that in UI Designer is an input field, I can get the contents of this contract in a groovy script?