2020-05-27 03:08:26 +00:00
---
stage: Plan
group: Project Management
2020-11-26 06:09:20 +00:00
info: 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
2020-05-27 03:08:26 +00:00
---
2020-06-09 18:08:28 +00:00
# Managing issues
2019-07-04 00:55:35 +00:00
[GitLab Issues ](index.md ) are the fundamental medium for collaborating on ideas and
2020-11-17 09:09:23 +00:00
planning work in GitLab.
Key actions for issues include:
- [Creating issues ](#create-a-new-issue )
- [Moving issues ](#moving-issues )
- [Closing issues ](#closing-issues )
- [Deleting issues ](#deleting-issues )
- [Promoting issues ](#promote-an-issue-to-an-epic ) ** (PREMIUM)**
2019-07-04 00:55:35 +00:00
2020-06-09 18:08:28 +00:00
## Create a new issue
2019-07-04 00:55:35 +00:00
2020-06-09 18:08:28 +00:00
When you create a new issue, you'll be prompted to fill in the [data and fields of the issue ](issue_data_and_actions.md ),
as illustrated below. If you know the values you want to assign to an issue, you can use the
[Quick actions ](../quick_actions.md ) feature to input values, instead of selecting them from lists.
2019-07-04 00:55:35 +00:00
2020-06-09 18:08:28 +00:00
While creating an issue, you can associate it to an existing epic from current group by
selecting it using **Epic** dropdown.
2019-07-04 00:55:35 +00:00
2020-06-09 18:08:28 +00:00
### Accessing the New Issue form
2019-07-04 00:55:35 +00:00
2020-06-09 18:08:28 +00:00
There are many ways to get to the New Issue form from within a project:
2019-07-04 00:55:35 +00:00
- Navigate to your **Project's Dashboard** > **Issues** > **New Issue** :
![New issue from the issue list view ](img/new_issue_from_tracker_list.png )
2020-11-17 00:09:16 +00:00
- From an **open issue** in your project, click the vertical ellipsis (**{ellipsis_v}**) button
to open a dropdown menu, and then click **New Issue** to create a new issue in the same project:
2019-07-04 00:55:35 +00:00
2020-11-17 00:09:16 +00:00
![New issue from an open issue ](img/new_issue_from_open_issue_v13_6.png )
2019-07-04 00:55:35 +00:00
- From your **Project's Dashboard** , click the plus sign (**+**) to open a dropdown
menu with a few options. Select **New Issue** to create an issue in that project:
![New issue from a project's dashboard ](img/new_issue_from_projects_dashboard.png )
- From an **Issue Board** , create a new issue by clicking on the plus sign (**+**) at the top of a list.
It opens a new issue for that project, pre-labeled with its respective list.
![From the issue board ](img/new_issue_from_issue_board.png )
2020-06-09 18:08:28 +00:00
### Elements of the New Issue form
2020-07-17 06:09:11 +00:00
> Ability to add the new issue to an epic [was introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13847) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.1.
2020-06-09 18:08:28 +00:00
![New issue from the issues list ](img/new_issue_v13_1.png )
When you're creating a new issue, these are the fields you can fill in:
- Title
- Description
- Checkbox to make the issue confidential
- Assignee
- Weight
- Epic ** (PREMIUM)**
- Due date
- Milestone
- Labels
2019-07-04 00:55:35 +00:00
### New issue from the group-level Issue Tracker
2020-06-09 18:08:28 +00:00
Go to the Group dashboard and click **Issues** in the sidebar to visit the Issue Tracker
2019-07-04 00:55:35 +00:00
for all projects in your Group. Select the project you'd like to add an issue for
using the dropdown button at the top-right of the page.
![Select project to create issue ](img/select_project_from_group_level_issue_tracker.png )
We'll keep track of the project you selected most recently, and use it as the default
for your next visit. This should save you a lot of time and clicks, if you mostly
create issues for the same project.
![Create issue from group-level issue tracker ](img/create_issue_from_group_level_issue_tracker.png )
2020-07-17 06:09:11 +00:00
### New issue via Service Desk
2019-07-04 00:55:35 +00:00
Enable [Service Desk ](../service_desk.md ) for your project and offer email support.
By doing so, when your customer sends a new email, a new issue can be created in
the appropriate project and followed up from there.
### New issue via email
A link to **Email a new issue to this project** is displayed at the bottom of a project's
**Issues List** page, if your GitLab instance has [incoming email ](../../../administration/incoming_email.md )
configured.
![Bottom of a project issues page ](img/new_issue_from_email.png )
When you click this link, an email address is generated and displayed, which should be used
by **you only** , to create issues in this project. You can save this address as a
2020-01-09 03:07:56 +00:00
contact in your email client for easy access.
2019-07-04 00:55:35 +00:00
2020-12-04 21:09:29 +00:00
WARNING:
2019-07-04 00:55:35 +00:00
This is a private email address, generated just for you. **Keep it to yourself** ,
as anyone who knows it can create issues or merge requests as if they
were you. If the address is compromised, or you'd like it to be regenerated for
any reason, click **Email a new issue to this project** again and click the reset link.
Sending an email to this address will create a new issue in your name for
this project, where:
- The email subject becomes the issue title.
- The email body becomes the issue description.
- [Markdown ](../../markdown.md ) and [quick actions ](../quick_actions.md ) are supported.
2020-12-04 21:09:29 +00:00
NOTE:
2019-07-04 00:55:35 +00:00
In GitLab 11.7, we updated the format of the generated email address. However the
older format is still supported, allowing existing aliases or contacts to continue working.
### New issue via URL with prefilled fields
You can link directly to the new issue page for a given project, with prefilled
field values using query string parameters in a URL. This is useful for embedding
a URL in an external HTML page, and also certain scenarios where you want the user to
create an issue with certain fields prefilled.
2020-05-08 09:09:39 +00:00
The title, description, description template, and confidential fields can be prefilled
using this method. You cannot pre-fill both the description and description template
fields in the same URL (since a description template also populates the description
field).
| Field | URL Parameter Name | Notes |
|----------------------|-----------------------|-------------------------------------------------------|
| title | `issue[title]` | |
| description | `issue[description]` | |
| description template | `issuable_template` | |
2020-10-01 12:10:14 +00:00
| issue type | `issue[issue_type]` | Either `incident` or `issue` |
2020-05-08 09:09:39 +00:00
| confidential | `issue[confidential]` | Parameter value must be `true` to set to confidential |
2019-07-04 00:55:35 +00:00
Follow these examples to form your new issue URL with prefilled fields.
- For a new issue in the GitLab Community Edition project with a pre-filled title
2020-05-22 03:08:28 +00:00
and a pre-filled description, the URL would be `https://gitlab.com/gitlab-org/gitlab-foss/-/issues/new?issue[title]=Validate%20new%20concept&issue[description]=Research%20idea`
2019-07-04 00:55:35 +00:00
- For a new issue in the GitLab Community Edition project with a pre-filled title
2020-05-22 03:08:28 +00:00
and a pre-filled description template, the URL would be `https://gitlab.com/gitlab-org/gitlab-foss/-/issues/new?issue[title]=Validate%20new%20concept&issuable_template=Research%20proposal`
2020-05-08 09:09:39 +00:00
- For a new issue in the GitLab Community Edition project with a pre-filled title,
2020-05-22 03:08:28 +00:00
a pre-filled description, and the confidential flag set, the URL would be `https://gitlab.com/gitlab-org/gitlab-foss/-/issues/new?issue[title]=Validate%20new%20concept&issue[description]=Research%20idea&issue[confidential]=true`
2019-07-04 00:55:35 +00:00
## Moving Issues
Moving an issue will copy it to a new location (project), and close it in the old project,
but it will not be deleted. There will also be a system note added to both issues
indicating where it came from and went to.
The "Move issue" button is at the bottom of the right-sidebar when viewing the issue.
![move issue - button ](img/sidebar_move_issue.png )
2019-07-04 06:24:39 +00:00
### Moving Issues in Bulk
If you have advanced technical skills you can also bulk move all the issues from one project to another in the rails console. The below script will move all the issues from one project to another that are not in status **closed** .
2020-04-21 15:21:10 +00:00
To access rails console run `sudo gitlab-rails console` on the GitLab server and run the below
2020-12-09 12:09:42 +00:00
script. Please be sure to change `project` , `admin_user` , and `target_project` to your values.
2020-04-21 15:21:10 +00:00
We do also recommend [creating a backup ](../../../raketasks/backup_restore.md#back-up-gitlab ) before
attempting any changes in the console.
2019-07-04 06:24:39 +00:00
```ruby
project = Project.find_by_full_path('full path of the project where issues are moved from')
issues = project.issues
admin_user = User.find_by_username('username of admin user') # make sure user has permissions to move the issues
target_project = Project.find_by_full_path('full path of target project where issues moved to')
issues.each do |issue|
if issue.state != "closed" & & issue.moved_to.nil?
Issues::MoveService.new(project, admin_user).execute(issue, target_project)
else
puts "issue with id: #{issue.id} and title: #{issue.title} was not moved"
end
end; nil
```
2020-06-09 18:08:28 +00:00
## Closing issues
2019-07-04 00:55:35 +00:00
When you decide that an issue is resolved, or no longer needed, you can close the issue
using the close button:
2020-11-17 00:09:16 +00:00
![close issue - button ](img/button_close_issue_v13_6.png )
2019-07-04 00:55:35 +00:00
You can also close an issue from the [Issue Boards ](../issue_board.md ) by dragging an issue card
from its list and dropping it into the **Closed** list.
![close issue from the Issue Board ](img/close_issue_from_board.gif )
### Closing issues automatically
2020-12-04 21:09:29 +00:00
NOTE:
2019-07-04 00:55:35 +00:00
For performance reasons, automatic issue closing is disabled for the very first
push from an existing repository.
When a commit or merge request resolves one or more issues, it is possible to have
these issues closed automatically when the commit or merge request reaches the project's
default branch.
If a commit message or merge request description contains text matching a [defined pattern ](#default-closing-pattern ),
all issues referenced in the matched text will be closed. This happens when the commit
is pushed to a project's [**default** branch ](../repository/branches/index.md#default-branch ),
or when a commit or merge request is merged into it.
For example, if `Closes #4, #6, Related to #5` is included in a Merge Request
description, issues `#4` and `#6` will close automatically when the MR is merged, but not `#5` .
Using `Related to` flags `#5` as a [related issue ](related_issues.md ),
but it will not close automatically.
![merge request closing issue when merged ](img/merge_request_closes_issue.png )
If the issue is in a different repository than the MR, add the full URL for the issue(s):
2020-05-19 18:08:11 +00:00
```markdown
2019-07-04 00:55:35 +00:00
Closes #4 , #6 , and https://gitlab.com/< username > /< projectname > /issues/< xxx >
```
#### Default closing pattern
When not specified, the default issue closing pattern as shown below will be used:
2020-01-30 15:09:15 +00:00
```shell
2020-04-21 15:21:10 +00:00
\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?: *,? +and +| * ,? *)?)|([A-Z][A-Z0-9_]+-\d+))+)
2019-07-04 00:55:35 +00:00
```
This translates to the following keywords:
- Close, Closes, Closed, Closing, close, closes, closed, closing
- Fix, Fixes, Fixed, Fixing, fix, fixes, fixed, fixing
- Resolve, Resolves, Resolved, Resolving, resolve, resolves, resolved, resolving
- Implement, Implements, Implemented, Implementing, implement, implements, implemented, implementing
2020-12-16 00:09:58 +00:00
Note that `%{issue_ref}` is a complex regular expression defined inside the GitLab
2019-07-04 00:55:35 +00:00
source code that can match references to:
- A local issue (`#123`).
- A cross-project issue (`group/project#123`).
- A link to an issue (`https://gitlab.example.com/group/project/issues/123`).
For example the following commit message:
2020-02-03 03:08:30 +00:00
```plaintext
2019-07-04 00:55:35 +00:00
Awesome commit message
Fix #20 , Fixes #21 and Closes group/otherproject#22.
This commit is also related to #17 and fixes #18 , #19
and https://gitlab.example.com/group/otherproject/issues/23.
```
will close `#18` , `#19` , `#20` , and `#21` in the project this commit is pushed to,
2020-01-09 03:07:56 +00:00
as well as `#22` and `#23` in `group/otherproject` . `#17` won't be closed as it does
2019-07-04 00:55:35 +00:00
not match the pattern. It works with multi-line commit messages as well as one-liners
when used from the command line with `git commit -m` .
2020-01-08 00:07:43 +00:00
#### Disabling automatic issue closing
2020-05-25 21:08:00 +00:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/19754) in GitLab 12.7.
2020-01-08 00:07:43 +00:00
The automatic issue closing feature can be disabled on a per-project basis
within the [project's repository settings ](../settings/index.md ). Referenced
issues will still be displayed as such but won't be closed automatically.
![disable issue auto close - settings ](img/disable_issue_auto_close.png )
This only applies to issues affected by new merge requests or commits. Already
closed issues remain as-is. Disabling automatic issue closing only affects merge
requests *within* the project and won't prevent other projects from closing it
via cross-project issues.
2019-07-08 08:50:38 +00:00
#### Customizing the issue closing pattern **(CORE ONLY)**
2019-07-04 00:55:35 +00:00
2019-07-04 06:24:39 +00:00
In order to change the default issue closing pattern, GitLab administrators must edit the
2019-07-04 00:55:35 +00:00
[`gitlab.rb` or `gitlab.yml` file ](../../../administration/issue_closing_pattern.md )
of your installation.
2020-06-09 18:08:28 +00:00
## Deleting issues
2019-07-04 00:55:35 +00:00
2020-07-26 21:09:17 +00:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/2982) in GitLab 8.6.
2019-07-04 00:55:35 +00:00
Users with [project owner permission ](../../permissions.md ) can delete an issue by
2019-07-04 06:24:39 +00:00
editing it and clicking on the delete button.
2019-07-04 00:55:35 +00:00
![delete issue - button ](img/delete_issue.png )
2020-07-26 21:09:17 +00:00
2020-11-17 09:09:23 +00:00
## Promote an issue to an epic **(PREMIUM)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/3777) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.6.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/37081) to [GitLab Premium](https://about.gitlab.com/pricing/) in 12.8.
> - Promoting issues to epics via the UI [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233974) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.6.
You can promote an issue to an epic in the immediate parent group.
To promote an issue to an epic:
1. In an issue, select the vertical ellipsis (**{ellipsis_v}**) button.
1. Select **Promote to epic** .
Alternatively, you can use the `/promote` [quick action ](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics ).
Read more about promoting an issue to an epic on the [Manage epics page ](../../group/epics/manage_epics.md#promote-an-issue-to-an-epic ).
2020-07-26 21:09:17 +00:00
## Add an issue to an iteration **(STARTER)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216158) in [GitLab Starter](https://about.gitlab.com/pricing/) 13.2.
To add an issue to an [iteration ](../../group/iterations/index.md ):
1. In an issue sidebar, click **Edit** next to **Iteration** . A dropdown appears.
1. Click an iteration you'd like to associate this issue with.
2020-08-05 18:09:49 +00:00
You can also use the `/iteration`
[quick action ](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics )
in a comment or description field.