the currentUser variable returns null in camunda 7.16 & 7.17
the request has to be authenticated. Usually it is authentiacted when you do the request from tasklist after a login.
Otherwise you have to call
identityService.setAuthenticatedUserId() before you start the process instance or complete the user task.
Hope this helps, Ingo