Feature #35749

Call Redmine::Hook.call_hook(:model_changeset_scan_commit_for_issue_ids_pre_issue_update) not only in case of a fixed issue with 'fixes' keyword

Added by Sandro Frenzel 2 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:

Description

In

app/models/changeset.rb

there is a hook :model_changeset_scan_commit_for_issue_ids_pre_issue_update which is called only if an issue was marked as fixed ('fixes' keyword) within a commit message.

So, there is no possibility to run an own adapter or do other things when an issue just changed within a commit message with 'refs' keyword.

Moving the lines

    Redmine::Hook.call_hook(:model_changeset_scan_commit_for_issue_ids_pre_issue_update,
                            {:changeset => self, :issue => issue, :action => action})

in the
def fix_issue(issue, action)

function after the fix_issue() and log_time() call
          unless repository.created_on && committed_on && committed_on < repository.created_on
            fix_issue(issue, action) if fix_keywords.include?(action)
            log_time(issue, hours) if hours && Setting.commit_logtime_enabled?
            Redmine::Hook.call_hook(:model_changeset_scan_commit_for_issue_ids_pre_issue_update,
                            {:changeset => self, :issue => issue, :action => action})
          end

will invoke the :model_changeset_scan_commit_for_issue_ids_pre_issue_update hook also if there was just the 'refs' keyword used.

Well, is there a reason to call this hook only in case an issue was changed to 'fixed'?

Also available in: Atom PDF