For a long time now, I've used the following behaviors initializer script to enforce a default comment visibility level of an 'Internal' project role (with role ID 11400) on new comments by internal employees:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FormField
def userInternal = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def groupsInternal = ComponentAccessor.userUtil.getGroupNamesForUser(userInternal.name)
FormField commentSec = getFieldById("commentLevel")
if (groupsInternal.contains("Internal Users"))
commentSec.setFormValue("role:11400")It's worked pretty well through several JIRA updates, with a few quirks, but was good enough to satisfy security concerns around discussions on issues.
Something must've changed in the JIRA 7.3.x family of updates, but this script now fails to work when loading the comment box at the bottom of the issue detail page. Comments left on modals (edit issue, transition issue, etc) still process the behavior correctly, but for whatever reason, the most comment place comments are left have stopped running the script.
Is there a change I need to make to the behavior to support something different about this particular instance of the comment editor, or am I out of luck? A solution that requires editing JIRA source code isn't an option, so it's either making ScriptRunner work again, or considering the third-party add-on that manages comment security defaults instead.
Thanks all.