Fixes preserving external author on work item move and clone

What does this MR do and why?

Fixes preserving external author on work item move and clone

This fix corrects a bug where we would add the Service Desk email address as external author when moving or cloning a work item.

Now we copy the external author from the original work item if present.

Changelog: fixed

Why do we see it now?

This implementation was introduced several milestones ago but only really visible today because we added the external author to the work item detail view last week or so.

Root Cause Analysis

The service_desk_reply_to method in CopyDataHandler assumes that if the target project has service desk enabled, the moved work item should have the service desk address set. This is incorrect because:

  1. Non-service-desk issues shouldn't get a service desk address - Only issues created via service desk (with support_bot as author) should have this field set
  2. The original value should be preserved or cleared - If the original work item had an external author, it should be preserved; otherwise, it should be nil
  3. Service desk address is project-specific - The service desk address is tied to the project's service desk configuration, not to whether an issue is being moved there

References

  1. Requester widget MVC (#414317)
  2. Migrate Service Desk list frontend app to work ... (#505027)

Screenshots or screen recordings

Issue (or any other WIT)

Before After
image image

Ticket

Before After
image image

How to set up and validate locally

  1. Set up Service Desk and create a new ticket using this snippet
  2. Move the ticket to another project
  3. See that the external author is not overwritten
  4. Create an issue and move it to another project.
  5. See that it doesn't have an external author.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marc Saleiko

Merge request reports

Loading