Project

General

Profile

Detecting issue state changes in hooks

Added by Julien M almost 8 years ago

Hi !

I developed a redmine plugin for notification in XMPP MUC rooms.
So far so good, it works.

The code is here : https://github.com/YunoHost/redmine_xmpp_muc_notifications

I would like to detect state transition in issues (issue being closed/reopened), and I can't find a way.

This part of the code :
https://github.com/YunoHost/redmine_xmpp_muc_notifications/blob/master/lib/notifier_hook.rb#L10-L16
always returns "updated".

Among other things I tried, the current code reflects my attempt to use the method of this plugin : https://github.com/scurvy/irc_notifications/blob/master/lib/notifier_hook.rb , where I changed the method names according to what I found in the Issue class (I use redmine 3.2). But no luck.

Do you know a way to achieve this?

Thanks in advance,
ju


Replies (1)

RE: Detecting issue state changes in hooks - Added by César DJ Caësar 9114 almost 8 years ago

Salut Julien,
I want to do the same thing (I mean, get those events when they appear), and I think the best way to do it is to use hooks.
Unfortunately, there is nothing in that list that can get a deleted issue.
The "controller_issues_edit_after_save" you're using works only for issues that are really being edited, and deletion or reopening is not an edition.

You can check if there are new hooks in the last version of Redmine (see the command at the top of this page )

    (1-1/1)