Previous controlls when adding worklog

Is there any possibility to perform pre-checks when worklog is being added?
I want to be able to control, depending on the value of the fields of the issue or depending on the response that external systems give me, if worklog can be added, and if there is any incompatibility, give an error.

Now the only way I’ve seen is by listening for webhooks, but this doesn’t prevent worklog from being added.