Hi,
I'm trying to setup a custom event with template Issue Commented that is thrown (through a Script Listener) when a Issue Commented event is thrown, except for comments added by a specific user.
I've created the new event like:
Task Commented => Template = Issue Commented
...and I've added the related Script Listener:
Project: XXX
Event: Issue Commented
Condition:
import com.atlassian.jira.component.ComponentAccessor
if (comments) {
//return comments*.authorKey[-1] == "Anonymous"
return ComponentManager.getCommentManager().getComments(issue).last().author == "Anonymous"
} else {
return false
}Event: Task Commented
I've associated to the new event the requested notifications and then had a test.
The result is:
Task Commented notification arrives but it has no comment in it's body:
TaskCommented.png
If I do the same test enabling notifications for event Issue Commented (the original one) I get the notification with the comment within it's body.
Why this?
How can I reach the requested result?
Thank you in advance
Regards