# OpenProject integration

> Connect OpenProject to Arcus, sync active sprints, generate test cases from work packages, trace them back, and log defects as work packages.

The **OpenProject integration** syncs the active sprints and work packages of your OpenProject projects into Arcus. You generate test cases from them in QI Home, trace accepted test cases back to their work packages, and log defects as work packages.

Setting up the integration needs administrator access in OpenProject, to add an OAuth application and a webhook. 

## How it works

Once a project is linked, Arcus syncs its active sprints with their stories and tasks. Each sprint appears on the **Sprints** tab of QI Home. 

After the first sync, Arcus keeps the work packages current:

- **New and updated work packages**: Arcus syncs the change. A work package added to a sprint after its test cases were generated appears in the Arcus sprint marked as new, ready to generate. 
- **Deleted work packages**: Arcus detects the deletion. Test cases linked to a deleted work package stay in your library. 

Arcus receives these changes through a webhook that you add in OpenProject. 

The connection shows its current sync status. To sync right away, open the connection and click **Sync Now**. 

## Connect OpenProject

You create an OAuth application in OpenProject, then enter its credentials in Arcus.

1. Go to **Settings** > **Integrations**.

2. Click **Setup Integration** on the **OpenProject** card. The **Connect OpenProject** dialog opens, with the OpenProject steps on the left and the Arcus fields on the right.

3. In OpenProject, open **Administration** > **Authentication** > **OAuth applications**.

4. Add an application named `Arcus`.

5. Copy the **Redirect URI** and the **Scope** (`api_v3`) from the Arcus dialog into the new application.

6. Turn on **Confidential**. OpenProject issues a client secret only for a confidential application.

7. Save the application.

8. Copy the client ID and client secret that OpenProject shows.

9. In Arcus, enter the **Instance URL**, the address you use to open OpenProject, for example `https://openproject.example.com`.

10. Enter the **Client ID** and **Client secret**.

11. Click **Connect**. OpenProject asks you to approve access for Arcus.

12. Approve the access in OpenProject. The **OpenProject** card shows **Connected**. 

[IMAGE: Connect OpenProject dialog with the IN OPENPROJECT steps on the left and the Instance URL, Client ID, and Client secret fields on the right. Crop to the dialog.]

For the OpenProject side of the setup, click **View setup guide** in the dialog, or see the OAuth applications documentation from OpenProject. 

## Add the webhook

Arcus doesn't create the webhook. Add it in OpenProject with the URL and secret from Arcus.

1. In Arcus, copy the webhook URL and the secret. 

2. In OpenProject, add a webhook with that URL and secret. See the webhooks documentation from OpenProject for where to add it.

3. Select the events for created and updated work packages. 

4. Save the webhook.

OpenProject holds webhook events for about 5 minutes by default, so changes take that long to reach Arcus. To send them right away, set the aggregation time to 0 at `https:///admin/settings/aggregation`. 

## Link an Arcus project to OpenProject projects

An Arcus project can link to one or more OpenProject projects.

1. Open the project switcher and click **Project Settings**.

2. Under **Project Management Tool**, click the link button for OpenProject. 

3. Select one or more OpenProject projects.

4. **(Optional)** Select a subproject. You can add or change a subproject while its parent project stays linked. 

5. Save the link.  Arcus syncs the active sprints of the linked projects.

## Generate test cases for a sprint

The Test Authoring Agent generates test cases for every story in the sprint in one session.

1. Open **QI Home**. Synced sprints appear on the **Sprints** tab under **CURRENT SPRINTS**. 

2. Click **Generate** on the sprint.

3. **(Optional)** In the session, click **+** to attach more context, such as a Figma design or a recording.

The session continues as for any sprint: approve the **Generation Plan**, generate test cases for the scenarios, then review them. See [Test generation and quality](https://testsigma.com/docs/v2/docs/arcus/v2/qi-home/generate-tests/) for the review steps.

## Generate test cases for one work package

Use an Adhoc session to generate test cases for a single work package, such as one story.

1. Open **QI Home** and open the **Adhoc** tab.

2. Click **Add Context** and select **OpenProject**.

3. Select the project, the work package type, and the work package. 

4. **(Optional)** Attach more context from any other source.

5. Click **Save**.

6. Enter a prompt.

7. Click **Send**.

## Trace test cases to work packages

When you accept a generated test case, Arcus links it to the work package it was generated from.

To link or unlink a test case manually, open the test case and click **Link Project** under **REQUIREMENTS** in the right panel. 

## Log a defect as a work package

Log a defect from a test run, either as a new OpenProject work package or by linking one that already exists. 

1. Open **Test Runs**, then open a test run.

2. Click the test case you want to log a defect against. The quick view panel opens.

3. Click **Add a Defect**. The **Add a Defect** dialog opens. 

### Create a new work package

1. In the **Add a Defect** dialog, open the tab for creating a new work package. 

2. Complete the fields. **Assignee** is optional and lists only members of the OpenProject project. To assign a defect to someone, add them as a project member in OpenProject first. 

3. Click the create button.  Arcus creates the work package in OpenProject and links it to the test case as a defect.

### Link an existing work package

1. In the **Add a Defect** dialog, open the tab for linking an existing work package. 

2. Select the work packages to link. 

3. Click the link button.
