Hi,
I'm trying to create a validator using JMWE which would ensure that a comment entered during a transition is not an external/public comment, but an internal comment instead.
Basically, how this works in Jira is that in JSM, a pop-up will display when you have a screen configured with the transition, which will contain the Comment field. Being a JSM project, the Comment field will present itself with two tabs: 1. Respond to Customer, 2. Internal comment with the first one being active by default.
As you know, users often times (even with training) will simply add a comment and submit without double-checking which tab is selected (in this specific scenario, I want the comment to always be internal-only), which would cause trouble with our customers.
That said, regardless of which tab is selected, I wanted to use the JMWE validator to alert the user in case the wrong tab is selected.
In contacting JMWE support, they told this used to be possible with the following Jira Expression, which would force the user to input a public comment (which is the opposite of what I want) during a transition. However, it is not working as intended anymore:
issue.comments.some(c=>c.id == null) && (!issue.comments.filter(c=>c.id == null)[0].properties.get("sd.public.comment")|| !issue.comments.filter(c=>c.id == null)[0].properties.get("sd.public.comment").internal)
Not sure if this is a regression bug in JSM or Atlassian intentionally blocked this from working...
Any help will be greatly appreciated.
Cheers!