1---
2stage: Plan
3group: Project Management
4info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
5---
6
7# Crosslinking issues **(FREE)**
8
9There are several ways to mention an issue or make [issues](index.md) appear in each other's
10[Linked issues](related_issues.md) section.
11
12For more information on GitLab Issues, read the [issues documentation](index.md).
13
14## From commit messages
15
16Every time you mention an issue in your commit message, you're creating
17a relationship between the two stages of the development workflow: the
18issue itself and the first commit related to that issue.
19
20If the issue and the code you're committing are both in the same project,
21add `#xxx` to the commit message, where `xxx` is the issue number.
22
23```shell
24git commit -m "this is my commit message. Ref #xxx"
25```
26
27If they are in different projects, but in the same group,
28add `projectname#xxx` to the commit message.
29
30```shell
31git commit -m "this is my commit message. Ref projectname#xxx"
32```
33
34If they are not in the same group, you can add the full URL to the issue
35(`https://gitlab.com/<username>/<projectname>/issues/<xxx>`).
36
37```shell
38git commit -m "this is my commit message. Related to https://gitlab.com/<username>/<projectname>/issues/<xxx>"
39```
40
41Of course, you can replace `gitlab.com` with the URL of your own GitLab instance.
42
43Linking your first commit to your issue is relevant
44for tracking your process with [GitLab Value Stream Analytics](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/).
45It measures the time taken for planning the implementation of that issue,
46which is the time between creating an issue and making the first commit.
47
48## From linked issues
49
50Mentioning linked issues in merge requests and other issues helps your team members and
51collaborators know that there are opened issues regarding the same topic.
52
53You do that as explained above, when [mentioning an issue from a commit message](#from-commit-messages).
54
55When mentioning issue `#111` in issue `#222`, issue `#111` also displays a notification
56in its tracker. That is, you only need to mention the relationship once for it to
57display in both issues. The same is valid when mentioning issues in [merge requests](#from-merge-requests).
58
59![issue mentioned in issue](img/mention_in_issue.png)
60
61## From merge requests
62
63Mentioning issues in merge request comments works exactly the same way as
64they do for [linked issues](#from-linked-issues).
65
66When you mention an issue in a merge request description, it
67[links the issue and merge request together](#from-linked-issues). Additionally,
68you can also [set an issue to close automatically](managing_issues.md#closing-issues-automatically)
69as soon as the merge request is merged.
70
71![issue mentioned in MR](img/mention_in_merge_request.png)
72