> For the complete documentation index, see [llms.txt](https://knowledgebase.autorabit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.autorabit.com/product-guides/codescan/getting-started/using-codescan/adding-projects-to-codescan/add-a-project-to-codescan-from-bitbucket.md).

# Add a Project to CodeScan from Bitbucket

This document is a guide on how to add a Bitbucket project to your CodeScan cloud account and run the analysis.

1. Login to your CodeScan account.
2. Once you login into your [CodeScan](https://www.codescan.io/) account, on the top right corner, click on the (**+**) icon and select **Analyze new project**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Ftz1LXUyMjPBkqdg7v12X%2FAnalyzeProzect%205.9.png?alt=media&amp;token=105733f5-dc31-4fcc-97e6-e54c5509274a" alt=""><figcaption></figcaption></figure>

3. It takes you to a different window. Choose the **Organization** for which you'd like to create a project.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FQ1dHOap4V8NkoHgejHrq%2FProjectSetup%207.7.png?alt=media&amp;token=4c780306-ac15-46f5-85bf-7a3659ec6c56" alt="" width="563"><figcaption></figcaption></figure>

4. In the next window, click on **Add Analysis Project** option.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F4fqjPAJn78RRsSTQs9hK%2FAnalysis%20Project%206.1.png?alt=media&amp;token=de5c2029-31f6-4120-b210-f0667029c4ec" alt=""><figcaption></figcaption></figure>

5. You will now see a new popup window, select [**Bitbucket**](https://knowledgebase.autorabit.com/codescan/docs/integrating-codescan-in-bitbucket-pipelines) from the given options.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FGGv4yLpGrpvXVHLAX7wq%2FBitbucket%206.9.png?alt=media&amp;token=19af3d0f-d480-41ce-9d4b-21054383e3f7" alt="" width="563"><figcaption></figcaption></figure>

6. Once you select **Bitbucket**, it will redirect you to the **Bitbucket login** page. Validate your credentials and click on **Login**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FbYxPPRzgHNG5fdcKLgYf%2Fimage.png?alt=media&amp;token=95f23824-e43c-4df8-b828-f270acdb2404" alt="" width="328"><figcaption></figcaption></figure>

7. Enter the necessary information in the below fields and then click on **Add and Run Now.**

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Frcasj6WusI9uai4BZTLP%2FBitbucket%20Run%207.0.png?alt=media&amp;token=f1b23bba-9544-44c1-8b58-2ce914400865" alt="" width="375"><figcaption></figcaption></figure>

* Choose the repository you want to add followed by the **Project Branch** name.
* Make sure you select the checkbox under **Check Pull Requests**.
* Now, enter the **project key** followed by the **project name**.
* Once you fill out all the details in the popup window, select **Add and Run Now**.

{% hint style="info" %}
**Note:** To know where to find the project key, refer to our document on how to do it by clicking [HERE](https://knowledgebase.autorabit.com/codescan/docs/finding-your-project-key).
{% endhint %}

8. This triggers the project analysis along with the project being added under your CodeScan organization.
9. You can view the project analysis report by clicking on **CodeScan builds** from your VC repository.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FcwXeDWZJxCPdw62RGcSq%2FBit%20Analysis%207.1.png?alt=media&amp;token=80acd0f4-62c3-4ab0-80c7-6a96f556bf08" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FRfzYYQd2waYrlEmVtfTg%2FBit%20Build%207.2.png?alt=media&amp;token=d4dd99ce-4c5f-41be-97a8-5f12d3ce3ff9" alt=""><figcaption></figcaption></figure>

10. When you click the link, it will take you to the **CodeScan Project** page, where you can view your Analysis report.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FI6UvPvVK7tii8wkapoI6%2FBit%20build%207.3.png?alt=media&amp;token=cf33cf08-bc57-4aee-88f8-52b28b8f3d51" alt=""><figcaption></figcaption></figure>

Now that the webhooks have been created, every time there is a push to the tracked branch or a pull request made/updated against the tracked branch, an analysis will be triggered in CodeScan.


---

# 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://knowledgebase.autorabit.com/product-guides/codescan/getting-started/using-codescan/adding-projects-to-codescan/add-a-project-to-codescan-from-bitbucket.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.
