Using Behaviours, you can restrict a comment’s visibility by setting the field options for the
commentLevel field. This is a particularly useful feature for those who want to ensure that comments added during edit/transition issue can only be seen by certain users.
Restrict by Role and/or Group
Imagine that you have a workflow step where you want to require the user to enter a comment in order to move forward with the transition. In addition to requiring a comment, you only want users in the Administrators role or jira-administrators group to be able to see this comment.
setFieldOptions on the
commentLevel field, this can be easily accomplished.
Due to the limitations of behaviours, you can only restrict comment visibility on the Update/Edit Issue, Assign Issue, and Workflow Transition screens. You will not be able to restrict comment visibility if a user adds a comment through the view screen.
Note the use of
setFieldOptions. It has two forms:
Iterablepass a List (or any Iterable) of Role or Group objects
Mapa Map object, where the keys are in the format "group:groupname" or "role:roleID", and the values are the names of the respective Group(s) or Role(s) that will be displayed in the UI