Create worklog on behalf of another user- Jira cloud

Hello everyone,
I want to create a worklog through plugin that will log hours on behalf of another user?
Can I do this through REST API for Jira cloud, or there maybe is another way to developed this?
Thank you