If the current user (ie the one viewing your issue glance etc. ) is the one you would like to log time for, then simply using asUser() would be the best approach IMO, this also has the advantage that in the issue history it corectly shows that the user is creating the worklog.
If you are logging work after something like a web trigger event, where you don’t have a current user, I think you will have to use asApp and set the author manually.
Exactly, this is my question, using it asApp() how to set the user manually? I cannot find paylod specs for user in the rest api docs for jira cloud… so I hope for an example
Thank you. I already did it using asUser() but then I want to prevent users to access the default logging interface
While for the on premise Jira installations this seem possible by disabling some modules from System it is not possible in Jira Cloud
So I thought maybe I can remove users from work log permission and log it asApp() by using the user data as a parameter. Impersonation would not help I suppose