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

0 vote
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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,312 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot