redmine_custom_workflows
redmine_custom_workflows copied to clipboard
Add watchers
Hi, How to handle the event when adding an watchers? For example, when adding new watchers, send him custom emails.
@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...
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?
@VictorSF1 Have you solved it ? I have the same issue , I need to send notications(not email) to watchers using a custom script
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
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