Remove user from watchers in post function or listener Edited


In workflow create action I have post function which adds specific user to watcher list (service user). Goal is to enable sending email notifications about created issue to group of people (mailing list).  I wanted to first add this service user as a watcher and than after email notification is sent remove the user from watcher in order to avoid receiving spam.

The problem is that I can't force JIRA to remove user from watchers in post function (after firing JIRA issue created event) or in script listener (event Issue Created). stopWatching(user, issue) function just doesn't work. Moreover getWatchersUnsorted(issue) function gives me list of watchers (my service user is present in that list), but when I run isWatching(user, issue) method with my user it always returns false.

I also tried to programmatically reindex issue but this also didn't work.

Any ideas? Thanks,

1 answer

This widget could not be displayed.
Thomas Schlegel Community Champion May 10, 2017

Hi Eryk,

why don't you put them all in a self defined group and add the notification to that group in the notification scheme to the event "Issue Created"?


Hi Thomas,

Because I want to avoid managing those groups (new hires etc.) as an administrator.

Thomas Schlegel Community Champion May 10, 2017

but adding and removing users to/from the "add-and-remove-watchers-function" is also an administrative effort ;-)

You've got a point there :) But I also want to send those emails for specific issue types i.e. only Defects for one project, Story for another.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

83 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you