I realized that you can disable comments when transitioning from one status to another by setting the following property in the transition:
jira.permission.comment.user = false
I tried this approach when creating a ticket (e.g. Create) but it does not work. This propery probably does not exist before the issue is created so its understandable why it does not work. I want to use a Post Function approach by setting this property. Alas there isn't a "SetProperty" function. THere isa Script Post-Function available via Scriptrunner.
My question is will it work if I set the afformentioned property from a ScriptRunner Post-Function. I went ahead and tried adding the following inline script but it does not work.
System.setProperty("jira.permission.comment.user","false")
Ideally what I want is to disable commenting when the ticket is unassigned