Project

General

Profile

Run system command when issue is created/has status changed.

Added by Luís Eterovick almost 11 years ago

Whats the best way to run a system command when a issue is created or has its status changed?


Replies (2)

RE: Run system command when issue is created/has status changed. - Added by Jean-Baptiste Barth almost 11 years ago

There's no way to do that in Redmine core itself. I'd recommend 2 possible approaches :
  • either make a specific plugin that runs the command in a after_filter or in a standard redmine hook
  • or have a cron task that runs a script, which monitors issues updates and run the command if something changed

The first approach is easier if you have some ruby skills and the command is not too complicated, the second one could be done entirely via the REST API, which lets you use your favorite programming language.

RE: Run system command when issue is created/has status changed. - Added by Luís Eterovick almost 11 years ago

Back to this. I'm new to Ruby on Rails so i'm still trying to figure out whats the best way to do this.

I managed to do an after_filter implementation in IssuesController:

  after_filter :only => [:update] do |controller|
    logger.info IssueStatus.find(params[:issue][:status_id]).name
  end

which will print the new status of the issue.

Is there any way to do that in a plugin as suggested? I wanted to keep these modifications outside the original IssuesController implementation, but still with the same effect, running after the after_filter on :update of issues.

Thanks in advance

    (1-2/2)