JMWE Cloud: Transition comment visibility
This KB article explains how to configure a https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466226183 using a Jira Expression to enforce comment visibility (public or private) on a workflow transition.
Instructions
Add https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466226183to the desired workflow transition.
In the Jira Expression field, use one of the following expressions depending on whether you want to enforce a private or public comment.
Require a private comment
// Private comment required let toBoolean = b => typeof b == 'string' ? b == 'true' : b != null && b; let isPrivateComment = comment => comment != null && toBoolean(comment.properties.get('sd.public.comment')?.internal); isPrivateComment(issue.comments.filter(c => c.id == null)[0]);
Require a public comment
// Public comment required let toBoolean = b => typeof b == 'string' ? b == 'true' : b != null && b; let isPublicComment = comment => comment != null && !toBoolean(comment.properties.get('sd.public.comment')?.internal); isPublicComment(issue.comments.filter(c => c.id == null)[0]);
In the Error message field, enter a message to display when the validation fails (e.g., "A private comment is required to complete this transition.").
Click Add, then publish the workflow for the validator to take effect.
Once configured, users will only be able to perform the transition after adding a comment with the required visibility.