Skip to content

Add `project_reference` to issuable API

Proposal

Expose a method that allows the project reference/path for an issue or merge request to easily be retrieved and utilised in rules and summaries. For summaries that contain rules that query at the group level there is currently no way to link to the issue or merge request directly without crafting the project reference or using the web_url. Listing web urls could trigger spam detection

Benefits

  • To facilitate indexing of group level items in summaries
  • Reduce the possibility of spam detection by preventing using the full web_url

Method

Each issue or merge request belongs to a project so this will be available for every resource regardless of the query's scope (project/group)

  1. Implement a project_path method:
  • This method will return the relative path to the project including the group. For example, gitlab-org/gitlab
  1. Implement a `project_reference method:
  • This method will return the relative path including reference and iid to the issue or merge request resource itself. For example, gitlab-org/gitlab#123 or gitlab-org/gitlab!123