Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Notification for comments add by email handler, override the user preference

Ahmed Osman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 7, 2022

Hello,

I have a strange behavior when we add comments. The user preference is using “Do not notify me.” for his own comments.

If the comment has been added directly into Jira, this works fine and no notification is sent.

However, if it is done by email handler running script runner with this API, he gets notification. 

commentManager.create(foundIssue, jira_reporter, body, true)

NOTE: He is assignee and part of the watcher list

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
April 13, 2022

Hi @Ahmed Osman

Could you please share the entire code you are using for the Email Handler and a print screen of your Email Handler configuration?

Thank you and Kind regards,

Ram

Ahmed Osman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 21, 2022

Here is the block that set the comment:

if (search && search.total != 0) {
def foundResult = search.getResults()[0]
def key = foundResult.getKey()
def foundIssue = issueManager.getIssueObject(key);

// Found. Add a comment
def index = body.indexOf("From:")
if (index != -1) body = body.substring(0,index)

index = body.indexOf("-----Original Message-----")
if (index != -1) body = body.substring(0,index)


commentManager.create(foundIssue, jira_reporter, body, true)

Watchers.each { watcherManager.startWatching(it, foundIssue) }

add_attachement(jira_reporter, foundIssue)
changeAssignee(foundIssue, assignee)
changeStatus(foundIssue, action)
return
}

 

image.png

Suggest an answer

Log in or Sign up to answer