To retrieve current loggedIn userId in camunda cockpit.

I need to retrieve the current loggedIn userId in camunda cockpit. Please suggest me the best ways possible to achieve this requirement.

Hello my friend! Welcome again!
You can use the identity service to do this.

You can use it this way below:

String userId = execution.getProcessEngineServices()
                         .getIdentityService()
                         .getCurrentAuthentication()
                         .getUserId();

I hope this helps!

William Robert Alves