# Idea OP-11922 - Improve the workflow for copying work packages (within or across projects)

Project: OpenProject
Status: in specification
URL: https://community.openproject.org/work_packages/OP-11922

## RICE

| Attribute | Value |
| --- | --- |
| Reach |  |
| RICE Score |  |
| Votes | 1 |

## Requires

_No work packages_

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |

## Details

| Attribute | Value |
| --- | --- |
| Roadmap |  |
| Date |  |
| Target versions | Wish List |
| Module |  |
| Priority | Medium |
| List |  |
| Interest by |  |
| Labels |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |

## Description

### **Context**

This is an idea work package that will eventually be converted to a feature to improve the process of copying work packages. At this stage, we're noting potential challenges, open questions and ideas on how to tackle them.

### **The problem**

**Copying work packages today raises a lot of questions:**

  - Are work packages relations copied?
      - What if some related packages are also copied, and some not? Do the relations link to the copied work packages, or the originals?
  - Does the copied work package inherit the parents and children?
      - If parent, does copying it make copies of the children?
      - If a child, does it remain a child of the original parent?

**If work packages are copied between projects**, there are additional complexities:

  - Are relations maintained across projects?
      - What if the related work packages are also copied? Do the relations migrate to the copied work packages, or refer to the original?
  - Are file links maintained across projects?
      - What if the link was to a shared project folder? 
      - What if the the link was to a file not accessible the users of the new project?
  - What happens to custom fields that don't exist in the new project? 
      - What if the unavailable custom field are subsequently enabled at a later date? Do they appear again?
  - What happens to files that are referenced in the description?
      - Do they now refer to the original files or the copies?
      - What if the user chose not to copy the file links (if such an option is made available). 
  - When bulk copying, multiple types of work packages can be selected, with their own set of fields and custom fields.
      - How do we deal with conflicts coming from fields that are not available in the target project, which might be different for different work package types?

### Initial Ideas

  - A copy action should bring up a modal that allows the user to understand what will happen and make changes if necessary.
      - <mention class="mention" data-id="42086" data-type="user" data-text="@Wieland Lindenthal">@Wieland Lindenthal</mention> suggested that a "Quick copy" might be offered for users to make an immediate copy (presumably with logical defaults) without any further steps. (<mention class="mention" data-id="72513" data-type="user" data-text="@Parimal Satyal">@Parimal Satyal</mention>  wonders how we can communicate these defaults to the user so they understand what the action does and what has just happened after they click on it).
  - The copy modal should have smart defaults: the user can just click through to accept the defaults, or go ahead and tweak settings if they want something very precise.
      - These defaults would need to be obvious to the user (as in, the user should know what will happen with file links, relations, and what happens in the event of potential conflicts).
  - In case of conflicts when copying work packages across projects, we would need to find a way to present them on a case-by-case basis and offer users options to resolve the conflicts. For example:
      - *Tasks in Project 1 have a custom field "Designer" (type: user) that does not exist for Tasks in Project 2. What would you like to do?*
          - (admin) Enable this custom field in Project 2 and copy over the value.
          - Copy the value of the field to the description as text.
          - Ignore the field.
  - For linked files on Nextcloud:
      - Links to shared project folders should probably migrated (as in, a Feature moved from Project A linked to shared folder for Project A would be linked to the shared folder for Project B when moved to Project B)
      - Individual files linked to Project A will retain the original reference to the same files. If users of Project B do not have permission to view the file, they will need to be granted access by the administrator. (The file is not directly related to the project, so it behaves like any other linked file that the current OP user does not have access to on Nextcloud).
