---
sidebar_position: 4
title: Running Analysis
---

# Running Analysis

Analysis is where Zibby's AI reads your Jira ticket, studies your codebase, and produces code changes and test cases.

## Starting an Analysis

1. Go to your project's **Tickets** page
2. Click on a ticket to open its details
3. Click **Analyze**
4. Optionally add **additional context** or select an AI model
5. The analysis runs in the cloud (AWS Fargate)

## Analysis Pipeline

The AI runs through these steps automatically:

### 1. Setup

- Clones your GitHub repository into a secure container
- Creates a git baseline for tracking changes

### 2. Analyze Ticket

The AI reads:
- The Jira ticket summary and description
- Acceptance criteria and requirements
- Your codebase structure and existing code

It produces a **structured analysis** with:
- Understanding of the requirement
- Affected files and components
- Implementation approach
- Edge cases and considerations

If the ticket lacks sufficient detail, the analysis may stop here with a **"needs clarification"** status and explain what information is missing.

### 3. Generate Code

Based on the analysis, the AI:
- Writes or modifies code to implement the ticket
- Captures all changes as a git diff
- Lists affected files

You can review the diff side-by-side in the dashboard and create a **Pull Request** directly.

### 4. Generate Test Cases

The AI produces structured test cases including:
- Test case title and description
- Step-by-step instructions
- Test data and credentials
- Expected outcomes
- Preconditions and postconditions

### 5. Finalize

- Compiles the final report
- Uploads all artifacts to the dashboard
- Updates the execution status

## Custom Instructions

You can add custom prompt instructions for each AI node in **Project Settings > Node Configuration**:

- **analyze_ticket** — additional context about your architecture
- **generate_code** — coding standards, framework preferences
- **generate_test_cases** — test credentials, login flows, specific data to use

For example, to ensure tests use specific credentials:

```
Use test account for login:
Email: test@example.com
Password: TestPass123
```

## Analysis Statuses

| Status | Meaning |
|---|---|
| **running** | Analysis is in progress |
| **completed** | All steps finished successfully |
| **failed** | A step encountered an error |
| **blocked** | Ticket lacks information to proceed |

## Reviewing Analysis Results

After completion, the analysis page shows:

- **Pipeline progress** — status of each step with logs
- **Code Changes** — side-by-side diff with file tree
- **Test Cases** — editable test cases you can refine
- **Create PR** — one-click pull request creation
- **Suggested Changes** — AI suggestions for the ticket itself

## Running Tests from Analysis

Once test cases are generated, you can run them locally using the CLI:

```bash
zibby test --sources TC001,TC002 --execution <execution-id> --sync
```

Or copy the full command from the **Code** button in the dashboard.
