> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/10.7/user-guide/issues/fixing.md).

# Fixing issues

From the Enterprise edition, you can get AI-suggested fixes for your code issues in SonarQube Server 10.7.

{% hint style="info" %}
**For AI agents:** You're in the SonarQube Server 10.7 documentation. For a list of all 10.7 pages, see the [SonarQube Server 10.7 page index](https://3272878703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI10pmJWeVVXYITlQJllp%2Fuploads%2F3hUYrP7xi1bTWHVJojH6%2Fsonarqube-server-10.7-llms.txt?alt=media). For the whole site, see the [page index](https://docs.sonarsource.com/llms.txt) or the [full text](https://docs.sonarsource.com/llms-full.txt). For another version, replace 10.7 in the URL with that version. The [latest version](https://docs.sonarsource.com/sonarqube-server/) has no version number in its URL.
{% endhint %}

Depending on the issue, you may get fix suggestions:

* In the **How can I fix it?** tab of the [Retrieving issues](/sonarqube-server/10.7/user-guide/issues/retrieving.md).
* From the Enterprise edition, generated through AI: see **Getting AI-generated fix suggestions** below.

## Opening issues in your IDE <a href="#opening-in-ide" id="opening-in-ide"></a>

To speed up the time it takes to find and fix the issue, you can open the issue in your IDE provided the [SonarQube for IDE Connected Mode](/sonarqube-server/10.7/user-guide/sonarlint-connected-mode.md) has been properly set up in order to connect SonarQube for IDE with SonarQube Server.

{% hint style="info" %}
If you’ve already fixed the issue in your code, SonarQube for IDE will not be able to find it in the IDE; only matching code will be highlighted. Keep in mind that the revision or branch analyzed by SonarQube Server may not be the same as what you have opened in the IDE. When setting up Connected Mode, SonarQube for IDE considers the branch currently checked out in the IDE and tries to synchronize it with the most appropriate branch from the server (This is called branch matching in SonarQube for IDE).
{% endhint %}

To open an issue in your IDE:

1. [Retrieving issues](/sonarqube-server/10.7/user-guide/issues/retrieving.md) and open its detail view.
2. In the **Where is the issue?** tab, select **Open in IDE**.

## Getting AI-generated fix suggestions <a href="#getting-ai-generated-fix-suggestions" id="getting-ai-generated-fix-suggestions"></a>

*This feature is available in* [*Early Access*](https://www.sonarsource.com/legal/early-access/?_gl=1*1cnxd7l*_gcl_aw*R0NMLjE3MjYwNjEzMzYuQ2p3S0NBandfNFMzQmhBQUVpd0FfNjRZaHRaajloc0NiVllqSDlWQnBFNThseVJNU3AwRGZJXzFxVUlpVEM5OGNzeWdZTG9lenF1ZU1ob0NyMGtRQXZEX0J3RQ..*_gcl_au*NzgzMTE3MTA4LjE3MjQwNjY1Mjc.*_ga*MjA1OTIwMzU4OS4xNzI0MDY2NTI3*_ga_9JZ0GZ5TC6*MTcyNjA5MzA2Ni4zNy4xLjE3MjYwOTMwNzMuNTMuMC4w)*, in Enterprise Edition and above.*

If [AI-generated fix suggestions](/sonarqube-server/10.7/instance-administration/system-functions/enabling-ai-generated-fix-suggestions.md), you can generate fix suggestions for the issues detected in your projects. The suggestions are generated using OpenAI’s GPT-4.

To generate a fix suggestion:

1. [Retrieving issues](/sonarqube-server/10.7/user-guide/issues/retrieving.md) and open its detail view.
2. Go to the **Where is the Issue** or the **Code Fix** tab and click the **Generate Fix** button.

![](https://3272878703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI10pmJWeVVXYITlQJllp%2Fuploads%2Fgit-blob-049dc7c109d0a9d2a76588b574026c6ba8567e28%2F3a8accada1c0aa995efa05fd5bd0c0c8879b9841.png?alt=media)

You can then copy the generated fix suggestion to your IDE:

* manually, by copying and pasting the suggestion into your IDE.
* using the **Code Fix** > **View Fix in IDE** button if you use [SonarQube for IDE Connected Mode](/sonarqube-server/10.7/user-guide/sonarlint-connected-mode.md). This feature is available with SonarQube for VS Code, IntelliJ, and Eclipse.

Note that for some issues, AI-generated fix suggestions are not available.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/10.7/user-guide/issues/fixing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
