# Managing issues

In SonarQube, you can change the status of an issue in the following cases (see also [#life-cycle](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/solution-overview#life-cycle "mention")):

* If you want to fix the issue later, you can accept an issue. The issue status is then marked as **Accepted**.
* If you think the analysis is mistaken, you can mark it as **False positive**, provided you have the corresponding permission.

In addition, you can reassign an issue, tag an issue, and comment on an issue.

{% hint style="info" %}

* You can receive an email notification for issue-related events: see [configuring-notifications](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/issues/configuring-notifications "mention").
* You can manage external issues (issues detected by an external tool and imported into SonarQube) in the same way as internal issues. Be aware that managing an external issue within SonarQube has no impact on its state in the external tool. For example, when you mark an issue as **False positive** in SonarQube, it is not reflected in the external tool.
* As you edit issues, the related [metrics-definition](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/code-metrics/metrics-definition "mention"), for example, number of issues taken into account, will update automatically; as will the quality gate status if it’s relevant.
  {% endhint %}

## Accepting an issue <a href="#accepting" id="accepting"></a>

You may accept an issue if you decide to fix the issue later. Note that SonarQube ignores accepted issues in the quality reports and ratings of the code.

{% hint style="info" %}
You can add a comment to your issue change action. See [#commenting](#commenting "mention") for more information about issue comments.
{% endhint %}

The procedure below explains how to accept a single issue. To accept several issues at once, see [#bulk-change](#bulk-change "mention").

To accept an issue:

1\. Retrieve the issue as described above in [#retrieving](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/reviewing#retrieving "mention") (it’s not necessary to open the detail view).

2\. In the issue card, select the **Open** issue status and select **Accept** in the contextual menu as illustrated below. A **Status change comment** box appears.

![](https://3001318305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVhGCsZJo9Ao0Jjyhvpxl%2Fuploads%2Fgit-blob-2c5db8c1e4cd738f70a8b1dec70b62601af1993b%2F6f5068815977b974ba71a50f99b1ccc36df2b62d.png?alt=media)

3\. Enter your change comment (optional) and select **Resolve**. The issue status is changed to **Accepted**.

## Marking an issue as False positive <a href="#false-positive" id="false-positive"></a>

If the analysis is mistaken, you can mark an issue as False positive provided you have the Administer Issues permission on the project. Note that SonarQube ignores False positive issues in the quality reports and ratings of the code.

{% hint style="info" %}
You can add a comment to your issue change action. See [#commenting](#commenting "mention") for more information about issue comments.
{% endhint %}

The procedure below explains how to mark a single issue as False positive. To mark several issues at once, see [#bulk-change](#bulk-change "mention").

To mark an issue as False positive:

1. Retrieve the issue as described above in [#retrieving](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/reviewing#retrieving "mention") (it’s not necessary to open the detail view).
2. In the issue card, select the **Open** issue status and select **False positive** in the contextual menu. A **Status change comment** box appears.
3. Enter your change comment (optional) and select **Resolve**. The issue status is changed to **False positive**.

## Reopening an issue <a href="#reopening" id="reopening"></a>

You can reopen an Accepted issue (when it’s time to fix it) or a False positive issue (if it turns out to be a true positive).

The procedure below explains how to reopen a single issue. To reopen several issues at once, see [#bulk-change](#bulk-change "mention").

To reopen one or several issues:

1. Retrieve the issue as described above in [#retrieving](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/reviewing#retrieving "mention") (it’s not necessary to open the detail view).
2. In the issue card, select the **Accepted** or **False positive** issue status and select **Open** in the contextual menu. The issue status is reset to **Open**.

## Marking an issue as reviewed <a href="#marking-as-reviewed" id="marking-as-reviewed"></a>

To mark issues as reviewed, you may use the tagging feature: create the Reviewed tag and assign it to reviewed issues: see [#tagging](#tagging "mention"). This way, you can filter the reviewed issues by using the Tag filter.

## Assigning an issue <a href="#assigning" id="assigning"></a>

When possible, SonarQube assigns a default assignee at issue creation time (see [solution-overview](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/issues/solution-overview "mention") for more information). You can assign an unassigned issue to a user, reassign an issue to another user, or unassign an issue.

The procedure below explains how to assign a single issue. To assign several issues at once, see [#bulk-change](#bulk-change "mention").

To assign an issue:

1. Retrieve the issue as described above in [#retrieving](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/reviewing#retrieving "mention") (it’s not necessary to open the detail view). To filter the unassigned issues, select **Not assigned** in the **Assignee** filter.
2. In the issue card, click the assignee name or the **Not assigned** mention. The list of users to whom you can assign the issue appears.
3. In the list, select the new assignee (or select **Not assigned** in the list to unassign the issue).

## Tagging an issue <a href="#tagging" id="tagging"></a>

You can create tags and assign them to issues in order to retrieve issues more easily or to indicate a workflow step. For example, you can use a tag to mark an issue as reviewed. The figure below shows how tags are displayed in the issue item.

![](https://3001318305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVhGCsZJo9Ao0Jjyhvpxl%2Fuploads%2Fgit-blob-47c4224d89e438e5dcf1fa01f8fe3a95311d5b6b%2F714d4367feeed3221c8b56fad9269926a9f47632.png?alt=media)

{% hint style="info" %}
Rules can also be tagged (In particular, [built-in-rule-tags](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/rules/built-in-rule-tags "mention") may be assigned to some rules.). An issue inherits the tags assigned to the rule that raised the issue. You can remove the inherited tags.
{% endhint %}

The procedure below explains how to tag a single issue. To add or remove a tag to/from several issues at once, see [#bulk-change](#bulk-change "mention").

To manage the tags assigned to an issue:

1. Retrieve the issue you want to manage as described in [#retrieving](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/reviewing#retrieving "mention").
2. In the search results list or in the detail view, select in the **Tags** section if the issue. A dialog opens with the list of existing tags.
3. In the dialog, you can use the search field to search for an existing tag. To create a new tag, enter the new tag in the search field: the new tag will appear in the list of tags with a plus sign in front of it .
4. To assign or unassign a tag, select or clear the tag’s checkbox in the list.
5. Click anywhere outside the dialog to close the dialog.

![](https://3001318305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVhGCsZJo9Ao0Jjyhvpxl%2Fuploads%2Fgit-blob-a821d68f0785cfe1b8ff80693d78edeb9301557b%2Fef73bb2bf4b546e4b5dd82d670fd9128abb3caae.png?alt=media)

## Commenting on an issue <a href="#commenting" id="commenting"></a>

When accepting an issue or marking an issue as **False positive**, you can add a comment. You can also add a comment to an issue anytime. These comments are visible from the **Activity** tab of the issue: see [#history-and-comments](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/reviewing#history-and-comments "mention").

By default, comments are shared between all users (it can be disabled at the global level).

To add a comment to an issue:

1. Retrieve the issue and open its detail view as described in [#retrieving](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/reviewing#retrieving "mention").
2. Open the **Activity** tab.
3. Select **Add a comment**. The "Add a comment" dialog box opens.
4. Enter your comment and select **Comment**.
5. Your comment is added to the **Activity** tab.

## Suppressing the issues on a given line <a href="#suppressing" id="suppressing"></a>

In most languages, you can use the `//NOSONAR` comment at the end of a line to suppress all issues on the line. This will suppress all issues - now and in the future - that might be raised on the line.

{% hint style="warning" %}
Using this comment does not comply with [clean-as-you-code](https://docs.sonarsource.com/sonarqube-server/10.6/user-guide/clean-as-you-code "mention").
{% endhint %}

## Managing several issues in bulk <a href="#bulk-change" id="bulk-change"></a>

To manage several issues at once:

1\. In the list of filtered issues, select the issues you want to manage:

* * To select one issue, select the issue check box.
  * To select all issues, select the **Bulk change** check box. Issues you do not want included in your action can be individually unselected.

2\. Select the **Bulk change** button. The **Change issues** dialog opens.

![](https://3001318305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVhGCsZJo9Ao0Jjyhvpxl%2Fuploads%2Fgit-blob-4138d80b3939332e54c56cb510dd79447ae0fc4d%2Fe09eddc9f9b8a10eedbaf7b09275b4f474cd454f.png?alt=media)

3\. In the dialog, select the action you want to perform:

* * **Assign**: to assign the issues to the same user.
  * **Add tags**: to add the same tag to the issues.
  * **Remove tags**: to remove the same tag from the issues.
  * **Change status**: to reopen the issues, accept the issues, or mark the issues as **False positive**.

4\. Click **Apply**.
