# 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="/files/XrbT0vaFYJVgLEffGSj3" 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="/files/ic3jkuJ0Dw6Gpj4xlige" alt="" width="563"><figcaption></figcaption></figure>

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

<figure><img src="/files/ayUL9kuzeICfwbWmXQiQ" 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="/files/iuLl4mYBC0PiJvRW6Hf3" 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="/files/mOe9KXpHWNqqfeqg8Fcg" 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="/files/xShCfNKyEQhqOR3F46zD" 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="/files/IOUhPkA6ceNFAOkgDKPh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/mFWtnnwAwVEIOehXw3FA" 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="/files/G2U60wDyx9hNFKFF4Ago" 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
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>
```

The question should be specific, self-contained, and written in natural language.
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.
