Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add watchers #152

Open
VictorSF1 opened this issue Jan 15, 2020 · 5 comments
Open

Add watchers #152

VictorSF1 opened this issue Jan 15, 2020 · 5 comments

Comments

@VictorSF1
Copy link

VictorSF1 commented Jan 15, 2020

Hi,
How to handle the event when adding an watchers?
For example, when adding new watchers, send him custom emails.

@DolezalDavid
Copy link

@VictorSF1 What is reason to give info to user, that were add as watcher? If you add user as watcher and write comment, he receives notification...

@VictorSF1
Copy link
Author

If I write a comment, both the performer and other watchers will receive it.
And I need to send an custom message to the currently added watchers.
Are there any plans to add a trigger to watchers?

@oldunclez
Copy link

@VictorSF1 Have you solved it ? I have the same issue ,
I need to send notications(not email) to watchers using a custom script

@nekrasovdmitriy
Copy link

I managed to auto add specific watcher on specific status & tracker with this code:

# Check if the status_id of the issue has changed
if @issue.status_id_changed?

  # Check if the tracker_id of the issue is YOUR ID
  if @issue.tracker_id == YOUR ID

    # Check if the status_id is YOUR ID 
    if @issue.status_id == YOUR ID
      # Add watcher
      self.add_watcher(User.find_by_id(YOUR ID))
    end
  end
end

@oldunclez
Copy link

I managed to auto add specific watcher on specific status & tracker with this code:

# Check if the status_id of the issue has changed
if @issue.status_id_changed?

  # Check if the tracker_id of the issue is YOUR ID
  if @issue.tracker_id == YOUR ID

    # Check if the status_id is YOUR ID 
    if @issue.status_id == YOUR ID
      # Add watcher
      self.add_watcher(User.find_by_id(YOUR ID))
    end
  end
end

Thank you for your reply.
But maybe you misunderstand this issue.
It is to do something when adding watcher, instead of , adding watcher when status changed.
I am going to do it following https://www.redmine.org/issues/1757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants