Change comment visibility via email

I am trying to create a workflow that will create a comment only visible to a specific group. For some reason it turns the whole issue to be only visible to the reporter and the group. I would like it to only apply to the comment only and not the entire issue.

rule Change comment visible to
 
when issue.comments.isNotEmpty && comments.last.author.isInGroup("Dev"){
  if(comments.added.first.text.contains("@Dev",ignoreCase)){
    applyCommand("visible to Dev");
 }
}
0
7 comments
Hello Phillip,

the methos applyCommand() is always applied to a target issue, in your example to a current issue.
To set up visibility group to a comment please use the 'permittedGroup' field: comments.added.first.permittedGroup = {group: New Users};
0
Awesome, thanks Dmitry! That worked out for me. Although is there anyway to stop the reporter from receiving a notification (reporter is not part of the group).
0
Do you mean you'd like the comment or the issue reporter not to get notifications?

Issue reporter always has access to own issue and get notifications using standard subscription on the saved search 'Reported by me'.
0
Dmirty, that is correct. The reasoning behind all of this is because I would like to leave a developers note without the issue reporter ever seeing this. The note is meant for only the developers and not the issue reporter.
0
Well, it seems it's the most appropriate way. Just a note - I guess you have to use issue.comments.added.isNotEmpty instead of issue.comments.isNotEmpty.
0
This is the workflow now:

when issue.comments.added.isNotEmpty && comments.last.author.isInGroup("Dev") {
  if (comments.added.first.text.contains("@dev", ignoreCase)) {
    comments.added.first.permittedGroup = {Dev};
  }
}


So there is no way the issue report will not see the developers note?
0
Unfortunately no, each developer's comment should be restricted by the group.
0

Please sign in to leave a comment.