Is there a redmine API I can use to access the issues database?
I would like to write a program that accesses the issues database (read and write access, also for custom fields) in order to perform non-interactive manipulations and/or statistics on the issues.
For instance, I would like to send a daily mail to management with statistics on the last day's activity.
Another example: I would like to send a mail to management every time a critical bug is opened. I would also like to mark the bug so that a mail is not sent twice for the same bug.
Any help is appreciated.
RE: Programatic access - Added by Thomas Löber over 14 years ago
You can access your database directly and use SQL to query and update your data. This will bypass any validations that are usually done by Redmine. So I won't recommend this approach.
Or you can use "ruby script/runner FILENAME" and start a Ruby script which can use the Redmine model classes. For example (not tested):
user = User.find_by_login("admin") user.mail = "firstname.lastname@example.org" user.save!
Your second example is more complicated because you will need to override controller actions. This can be done inside a plugin, however.