I'm trying to set a security level value based on the issue type selected using ScriptRunner Listener.
I think this somewhat similar to this question but using issue type instead of custom field - https://community.atlassian.com/t5/Adaptavist-questions/Setting-issue-security-level-based-on-custom-field-value-using-a/qaq-p/1592935
My project uses four issue types: Bug, Task, Epic and Story. What I'm trying to achieve using the ScriptRunner is if someone creates a ticket using Bug or Task issue type then it will automatically set the Security Level to Security A. If Epic or Story is selected then it will automatically set the Security Level to Security B.
How do I do that using ScriptRunner? I don't know if I should be creating a Listener or using Post Function script (e.g. set issue security level depending on condition). My knowledge of groovy scripting is at the bottom of the totem pole so I would need someone to help me write the script and I can plug and play.