Work Item references in activity feeds point to the wrong place

Summary

Links to work items in activity feeds currently use the work_items URL but the issue iid. This means the link appears to be broken and tasks are not accessible from activity feeds.

This does not happen with regular comments or system notes because they use the issue URL, which detects a work item and redirects to the correct work item URL.

Steps to reproduce

  1. Add a task to an issue
  2. Visit your profile page
  3. View an item in your activity feed, "[you] Opened work item [#reference] .... "
  4. Click the linked #reference

Example Project

Any project on GitLab

What is the current bug behavior?

The work item page loads but is blank and contains an error.

What is the expected correct behavior?

The task loads in the work item view.

Possible fixes

Include the issue link in the system note instead of the work item link.