Restricting Comment Visibility
Behaviours allow you to control comment visibility by configuring the commentLevel field. You can either set specific options for this field or lock it to a fixed value. This feature is particularly useful when you want to restrict the visibility of comments added during issue editing or transitions to certain users only.
Set comment visibility for certain roles
You can use the following example to restrict the visibility of comments Administrators make to Administrators only when they're editing or transitioning an issue.
To check this behaviour works as expected, log in as an Administrator and try updating, editing, assigning, or transitioning an issue in your selected project.
Restrict comment by role and/or group
You can use the following example to limit the visibility of Administrator comments to only those in the Administrators role or jira-administrators group. This approach can be particularly useful when configuring workflow steps, especially if you want to require Administrators to comment before proceeding with a transition while keeping these comments restricted.
This can be easily accomplished by using the setFieldOptions method on the commentLevel field. This approach allows you to enforce comment requirements while also controlling who can view these comments, ensuring sensitive information remains visible only to authorized personnel.
To check this behaviour works as expected, log in as an administrator and try updating, editing, assigning, or transitioning an issue in your selected project. The administrator must enter a comment and select the required restriction for their comment.