Hi,
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?
Thanks!
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:
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.