Project

General

Profile

task #21

Copy issues' recurrence schemes on project/issue copy

Added by jonhalle about 4 years ago. Updated 10 months ago.

Status:
closed
Priority:
feature
Assignee:
Target version:
Redmine version:
unspecified

Description

Currently on issue or project copy the recurrences are not copied. In our use of this excellent plugin we create a project which is effectively a template, with several issues set up and recurrences set for them. We then copy that project each time we set up a new project, as the issues and recurrences are similar for all the projects we undertake. It would therefore be very useful for recurrences to be copied along with the issues. That might happen on project copy only, or on individual issue copy, and it might be possible to make it configurable.


Token votes

History

#1 Updated by cryptogopher about 4 years ago

  • Status changed from new to feedback

In our use of this excellent plugin ...

Thank you for kind words :)

we create a project which is effectively a template, with several issues set up and recurrences set for them. We then copy that project each time we set up a new project, as the issues and recurrences are similar for all the projects we undertake. It would therefore be very useful for recurrences to be copied along with the issues. That might happen on project copy only, or on individual issue copy, and it might be possible to make it configurable.

Can you please describe steps needed to:
  • copy project with its issues
  • copy issue

in your use cases? Just so I can replicate them and inspect whether and how copying of recurrences can be accomplished in such scenarios.

Regarding configuration settings: I'm not sure if it can be easily detected whether issue is copied as a part of a project copy or otherwise. So I need to go through the steps you'll provide to say anything more about that.

#2 Updated by jonhalle about 4 years ago

Thank you. We copy issues from "..." menu on issue list, or by selecting several issues and copying via right click menu. Projects are copied from /admin/projects page which does not have bulk copy.

On configuration: My earlier description implied that there could be a setting as to whether issue recurrences ought to be copied on project copy only or on any issue copy - actually I don't think that setting is necessary, I just worded it wrongly.

I don't think settings are strictly necessary at all - I think most users copying an issue would expect the whole issue to be copied with any additional attributes, including recurrences. But I might be wrong about that. So perhaps one setting might be good - in the recurring issues core config users could choose whether to copy recurrences or not as a global setting. That's not very flexible but coding a per-copy setting might be a bit too hard - not easy to see where the setting would go. I think the global would be fine.

I think the hook for an issue copy is controller_issues_move_before_save with the context :copy. Not sure if that gets called on project copy but I presume so. There is a project copy hook model_project_copy_before_save which could perhaps be used if not.

#3 Updated by cryptogopher about 4 years ago

  • Subject changed from Copy of recurring issues when an issue is copied to Copy issues' recurrence schemes on project/issue copy
  • Status changed from feedback to in progress

jonhalle wrote:

Thank you for detailed update.

I don't think settings are strictly necessary at all - I think most users copying an issue would expect the whole issue to be copied with any additional attributes, including recurrences. But I might be wrong about that. So perhaps one setting might be good - in the recurring issues core config users could choose whether to copy recurrences or not as a global setting. That's not very flexible but coding a per-copy setting might be a bit too hard - not easy to see where the setting would go. I think the global would be fine.

I think that at least option that allows to turn on/off recurrence schemes copy on issue copy is worth adding. If that won't be tricky I will extend this option to allow copy on project and/or issue only.

Right now only global (per plugin) settings are supported. Maybe sometime in the future I will move them to per-project options if that will be useful.

I think the hook for an issue copy is controller_issues_move_before_save with the context :copy. Not sure if that gets called on project copy but I presume so. There is a project copy hook model_project_copy_before_save which could perhaps be used if not.

I will take a look at it. But don't hold your breath, as it may take a longer while.

#4 Updated by cryptogopher almost 4 years ago

It looks like :controller_issues_move_before_save hook is no longer available (it's described on https://www.redmine.org/projects/redmine/wiki/Hooks_List, but that is outdated as current sources lack references to the hook).

For now the most universal/consistent way to handle copying recurrence schemes (both during issue and project copy) is to override Issue#copy_from. In Redmine 3.4 it is invoked from:
  • IssuesController#build_new_issue_from_params - for issue copy and
  • Project#copy_issues - for project copy,

#5 Updated by cryptogopher almost 4 years ago

  • Status changed from in progress to closed

Feature is available in release 1.6

#6 Updated by admin 10 months ago

  • Priority changed from support to feature

#7 Updated by admin 10 months ago

  • Tracker changed from 2 to task
  • Target version set to unspecified
  • Redmine version set to unspecified

Also available in: Atom PDF