unfortunately, I have not yet found a suitable answer, so I ask my question directly here:
- Once a comment is created, the comment content should be parsed to users mentioned as @mention.
- If a @mention is found, it should be checked if the user belongs to a certain project role or not.
- If the condition is met (@mention belongs to role), a mail should be sent to this user.
I thought that the rubric "Listener" would fit to this, but you can only store fixed mail addresses there.
What is the best way to proceed?
Actually, no, you don't have to rely on the fixed email address using the "Send a custom email" script listener.
You can use the "Condition and Configuration" script to set your recipients.
In that script, there is a "mail" variable in the binding.
So you can parse the comment there and then set mail.setTo("your recipients")
Note that when parsing your comment, you'll want to look for [~userName] not @DisplayName since the body of the comment is the underlying wiki format.
Another possibility to explore is to use a "Custom Listener" which allows you to Listen to the "MentionIssueComment" which has a built-in "toUsers()" method that contains the list of users mentioned in the comment.
But that means you would have to code your own interactions with the jira mail systems.
So 2 approaches:
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events