# Reattaching Bitbucket Projects

At AutoRABIT, we have made some changes to make our Bitbucket project webhooks more secure. To take advantage of this change, Bitbucket projects that were created in CodeScan need to be reattached.

[CodeScan Cloud](https://www.codescan.io/products/cloud/) allows you to do this *without erasing* the historical data present in your project. It will only reconnect the CodeScan project with the Bitbucket repository.

{% hint style="info" %}
This only affects projects created in CodeScan with our internal integration.

This **DOES NOT** include:

* Projects created from Bitbucket pipelines
* Projects being cloned from Bitbucket and scanned from a separate CI platform
  {% endhint %}

Follow these steps to reattach your project analysis:

1. Open your Bitbucket **project.**<br>

   <figure><img src="/files/8pa8vHyAwCxWlUL1AtvI" alt=""><figcaption><p>Open Your Bitbucket Project</p></figcaption></figure>
2. Navigate to the **Project Settings > Project Analysis** page.<br>

   <figure><img src="/files/LGxQ39QXjL6NWZDrb3Qr" alt=""><figcaption><p>Project Analysis page</p></figcaption></figure>
3. Make sure you do not have the "**Delete this project also?**" box checked. This will delete your history and is not reversible. Click **Delete Analysis**.<br>

   <figure><img src="/files/AnMbHR5BhAm2Hsv9Htdx" alt=""><figcaption><p>Delete Analysis</p></figcaption></figure>
4. Now use the **Attach Analysis Project** button at the top right of the screen to re-add the link.<br>

   <figure><img src="/files/YK1lx6IQ38xKzRyYvXLY" alt=""><figcaption><p>Attach Project Analysis</p></figcaption></figure>
5. You will now see a new popup window. Select the required option from the options given (e.g., Bitbucket).

<figure><img src="/files/YkXiaYKBxCqW6l6MdS1u" alt=""><figcaption><p>Add a New Project</p></figcaption></figure>

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

<figure><img src="/files/7lwMD7plfkv1VlaRsooY" alt="" width="375"><figcaption><p>Bitbucket</p></figcaption></figure>

8. Choose your **repository**.&#x20;
9. Make sure you select the checkbox under **Check Pull Requests**.

<figure><img src="/files/a9VC3fGqs3c5fXtNCgcN" alt=""><figcaption><p>Attach Analysis to Project</p></figcaption></figure>

10. Once you fill out all the details in the popup window, select **Add and Run Now**.
11. This triggers the project analysis along with the project being added under your CodeScan organization.


---

# 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/codescan-integration/bitbucket-pipelines/reattaching-bitbucket-projects.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.
