Patch #8757

Add hook for bulk edit post-save state

Added by Ramesh Nair over 6 years ago. Updated 6 months ago.

Status:NewStart date:2011-07-06
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Hook requests
Target version:-

Description

There is a hook which gets invoked just after an individual issue gets updated, which allows for plugins to perform any post-save actions. There ought to be a similar hook for when a number of issues have been updated via the bulk-editing process. I've patched the core code to enable such a hook - `controller_issues_bulk_edit_after_save`.

Patch available at https://github.com/7citylearning/redmine/commit/f88c6ca01e89246b5bcd62fa26cc651ee33ba212

issues_controller_bulk_update_after_save_hook.patch Magnifier (650 Bytes) Tobias Böhm, 2017-03-23 13:55


Related issues

Duplicated by Redmine - Feature #25454: Add bulk edit after save hook Closed

History

#1 Updated by Etienne Massip over 6 years ago

  • Category changed from Issues to Plugin API

#2 Updated by An Phan over 2 years ago

+1. Some of the webhook plugins out there is not complete because of this hook missing, for example Redmine Webhook.
I've no idea why this takes so long to be merged. There was even a patch 4 years ago: #5714. I mean, how hard can it be to add this one liner into issues_controller.rb?

call_hook(:controller_issues_bulk_edit_after_save, { :params => params, :issue => issue, :journal => journal })

#3 Updated by Hiroshi Miura over 2 years ago

+1. To improve user productivity with webhook or other plugins, and chat platforms such as hipchat, slack, kandan and hubot.

#4 Updated by Adam Pfeiffer over 1 year ago

I absolutely need this as well. It does seem to be a simple change that should have been there from the beginning. I will modify my code locally to make sure this works with my plugin.

THanks

#5 Updated by Joel SCHAAL over 1 year ago

+1

I would like to see that change in the next version.

Is this change too risky or too dirty ?
Does it need to be adapted before acceptance ?

#6 Updated by Naoki Yoshida about 1 year ago

+1

#7 Updated by Toshi MARUYAMA about 1 year ago

  • Category changed from Plugin API to Hook requests

#8 Updated by Tobias Böhm 7 months ago

I just created a patch for this issue that applies to the current master code base. Please find it attached.

#9 Updated by Toshi MARUYAMA 6 months ago

#10 Updated by Serghei Zagorinyak 6 months ago

This patch is wrong.

Implemented this way, if an exception is raised within bulk_edit_after_save it will prevent succeeding issues from being saved while they should be processed and only the problematic issue should be rejected.

#11 Updated by Tobias Böhm 6 months ago

You are right, exceptions raising from the hook are not handled. But this applies also to the already existing hook :controller_issues_bulk_edit_after_save. If an exception is raised there, all following issues will not be processed.

This should be addressed for the whole process (before-hook, save, after-hook) or loop at once, I guess, in a separate issue and patch.

#12 Updated by Serghei Zagorinyak 6 months ago

Tobias Böhm wrote:

You are right, exceptions raising from the hook are not handled. But this applies also to the already existing hook :controller_issues_bulk_edit_after_save. If an exception is raised there, all following issues will not be processed.

This should be addressed for the whole process (before-hook, save, after-hook) or loop at once, I guess, in a separate issue and patch.

Yes, didn't notice that first. Hope this will be fixed someday.

#13 Updated by Toshi MARUYAMA 6 months ago

#14 Updated by Toshi MARUYAMA 6 months ago

Also available in: Atom PDF