How to create and modify issue entity properties (server / data center)

I am working on an activity tracker server plugin and I am using Jira webhooks to get the data that I need and then parse it in a format which suits my needs. I want to be able to save the formatted data in issue entity properties, so I can search for it later using JQL.

My first thought was to use the REST API to send a request to the issue and save the data that way, but I am unable to authorize the request. ( in forge i use api.asApp().requestJira() but here no such solution exists ).

I find the Java API documentation awfully hard to read and with no real examples, so I am stuck without a way to set the properties.

Can anyone please give some advice or possibly share an example?

Thanks.