# Code view: pull requests and issues

How the Truetask Code view mirrors a repository's pull requests and issues on a board, links them to tasks, triages unlinked ones and holds its settings.

URL: https://docs.truetask.io/git/code-view

The Code view in Truetask is the board view that lists a linked repository's pull requests and issues, shows which task each one belongs to, and holds the repository's settings.
Every task board can have one, for GitHub, GitLab or Gitea.

The tab is named after the provider once a repository is linked, so it reads **GitHub**, **GitLab** or **Gitea**; before that it reads **Code**.
Database boards do not have it: a database is limited to List, Forms and Automations.
The Code view can never be a board's default view, because a board with no repository would open on the setup screen.

## Before a repository is linked

The view is not hidden when nothing is linked yet.
It shows **Bring your code to this board** and two steps.

| Step | What it does |
| --- | --- |
| **Connect a provider** | Done once for the whole workspace. The button opens Integrations on the git cards. Once a provider is connected, the step reads **Connected to {Provider}**. |
| **Link a repository** | Picks the repository this board follows. The button opens **Connect a repository**, locked to this board. |

Members who are not a workspace owner or admin see the same steps with the button greyed out and "Ask a workspace owner or admin to set this up."
See [Git integration](https://docs.truetask.io/git/) for both steps.

![Truetask board Code view before a repository is linked, with Bring your code to this board and its two steps](https://docs.truetask.io/screenshots/code-view-setup.webp)

## The header

The header names the repository and its provider.
When the board has several repositories, the name is a menu that switches between them.

| Control | Who sees it | What it does |
| --- | --- | --- |
| **Renew token** | Workspace owners and admins, while the repository's connection is down | Opens **Change token** for that connection. See [Keep a connection healthy](https://docs.truetask.io/git/#keep-a-connection-healthy). |
| The bolt, **Automate git** | Board admins | Opens the automations surface on its git triggers. See [Automations](https://docs.truetask.io/automations/) and [Triggers](https://docs.truetask.io/automations/triggers). |
| The gear, **Settings** | Anyone who can edit the board | Opens [Repository settings](https://docs.truetask.io/git/code-view#repository-settings). |
| **Sync** | Anyone who can edit the board | Pulls the repository's open pull requests and issues from the provider. |

## Pull requests and issues

Two tabs, **Pull requests** and **Issues**, each with its count.
Inside each tab, items are grouped by how they relate to tasks.

| Group | Meaning |
| --- | --- |
| **Linked** | The work is the task. Merging or closing on the provider completes the task, and automations fire. |
| **Referenced** | Related context only. It never completes a task and drives no automation. |
| **Unlinked** | Nothing on this board points at it yet. |

Click a group's heading to fold it; the view remembers which groups you folded, per board and tab, in that browser.
See [Linked or referenced](https://docs.truetask.io/git/tasks#linked-or-referenced).

![Truetask Code view listing a board's pull requests and issues](https://docs.truetask.io/screenshots/code-view.webp)

### A pull request

The row shows the state (**Open**, **Draft**, **Merged** or **Closed**), the review state when there is one, the CI badge, the number, and the source and target branch.
Clicking the title opens the [code review drawer](https://docs.truetask.io/git/code-review).
On hover, the row offers the [coding tool](https://docs.truetask.io/git/coding-tools) button and **Open review**.

### An issue

The row shows the title, the number and up to four labels; a closed issue is struck through.
Clicking the title opens the [issue drawer](https://docs.truetask.io/git/code-view#the-issue-drawer).
On hover, the row offers **Close issue** or **Reopen issue**, which changes the issue on the provider, and **Open on provider**.

### Tasks on a row

Under each item sit the tasks it is attached to, its author on the right, rendered as the teammate they are mapped to.

- A linked task is a solid chip, a referenced one a dashed chip.
Click a chip to open the task; its cross is **Unlink** or **Remove reference**.
- **Link a card**, or **Link another** once something is attached, searches the board's tasks.
Choose **Link** or **Reference** at the top of the picker, then the task.
- **Make a card** creates a task from the item and links it, while nothing is linked yet.
The new task takes the item's title and a link back to it; an issue also brings its description, and its mapped labels become tags.
It lands in the first open list; on a board with several lists, the caret beside it, **Add to list**, picks another.

Viewers see the chips but cannot change them.

### The issue drawer

Clicking an issue's title opens the issue drawer on the right: its body and its comments.
Anyone who can edit the board can post a **Comment**, change its **Labels**, **Assignees** and **Milestone**, and close or reopen it from here, and every change goes to the provider.
The drawer also lists the issue's **Linked tasks** and **Referenced tasks**, and has **Open on provider** and **Full screen**.

## Search and filters

The search box and **Filter** in the tab row work on what is loaded.

- Search matches a pull request's title, source branch and author, and an issue's title, description and author.
- **State** filters pull requests by Open, Draft, Merged or Closed, and issues by Open or Closed.
- **Link status** filters by Linked, Referenced or Unlinked.
- On **Issues**, **Labels** and **Assignees** filter by the labels and assignees actually present.

**Clear** resets them.
Switching tabs resets the filters; the search text carries over.

## Sync with the provider

**Sync** pulls the repository's open pull requests and issues from the provider.
It is in the view's header, in the views menu in the tab strip, and on an empty tab.

You rarely need it.
Linking a repository syncs it once, and after that the provider's webhook delivers changes as they happen.
Sync is the repair for a repository whose webhook is not registered, or after a long outage.

## The Unlinked rail on Kanban

Issues and pull requests that no task points at yet can be triaged from the Kanban view without leaving it.
Turn the rail on with the **Unlinked issues & PRs** button in the Kanban toolbar, or the same entry in the views menu in the tab strip.
It needs a linked repository and edit rights on the board.

The rail, **Unlinked**, has a search box, a switch between all, issues and pull requests, a refresh button and a close button.

- Drag an item onto a list to turn it into a task there.
- Click it to open its review drawer or its issue drawer.
- Right-click it for **Promote to task**, **Link to card**, **Reference to card**, **Mark as duplicate** (issues only), **Open review** or **Open issue**, and **Open in {Provider}**.

**Mark as duplicate** asks **Duplicate of which issue?**, then comments "Duplicate of #N" on the provider and closes the issue.

## Repository settings

The gear in the view's header opens **Repository settings** for the repository on show.
For a workspace owner or admin, **Board setup > Repository settings** in the board's page menu opens the same dialog, next to **Open repository**, which opens the repository on the provider.
It has six sections.

### Webhook

The heading says whether the provider's webhook is **Registered** or **Not registered**; a missing webhook opens the section by itself.
Inside: **Last event received**, the **Callback URL**, **Test delivery**, which asks the provider to send one, and **Re-register**, which points the webhook at this instance's current address.
If it never shows an event, the provider cannot reach this instance: set a public address and re-register, or send a test delivery.

### Labels & tags

Maps a provider label to a board tag.
An issue linked to a task, or turned into one, gives the task the mapped tag.
It works the other way too: an issue created from a task gets the task's tags as labels.

Pick a **Provider label** and a **Board tag**, then **Map**; the trash on a row removes it.
The refresh button pulls the latest labels from the provider.

### Recommended automations

The starter automations offered when you link the repository, each with a switch.
**Install** adds one that is not there, the switch turns an installed one on or off, and **Delete** removes it after asking.
Only a workspace owner or admin can change them.
See [Recommended automations](https://docs.truetask.io/git/#recommended-automations).

### Automation

Two built-in behaviors between the repository and the board.

| Setting | What it does |
| --- | --- |
| **Create a card from each new issue** | New issues that do not name a task key are added as tasks and linked. **Add to list** chooses where they land, **First open list** by default. Off by default. |
| **Close linked issues when a task is completed** | Completing a linked task closes its open issues on the provider. Linked pull requests are left for you to merge or close, and references are never touched. On by default. |

### CI gate

Controls whether CI can block merges for this repository.

| **Merge gate** | Effect |
| --- | --- |
| **Off** | CI never blocks a merge. |
| **Block failed CI** | A failed or cancelled CI run blocks the merge. |
| **Block failed or pending CI** | A pending or unknown CI run blocks it too. |

**Admin bypass** lets board admins explicitly bypass a blocked gate.
The badge on each pull request reflects the result; see [The CI badge and merge gating](https://docs.truetask.io/git/tasks#the-ci-badge-and-merge-gating).

### Slack and Teams notifications

Sends this repository's pull request, issue, CI, commit and comment events to a team channel.
Turn on **Send repository events to a team channel**, then pick the **Channel type**.

| **Channel type** | What it asks for |
| --- | --- |
| **Slack (connected workspace)** | A **Channel** from the workspace's Slack connection, or the connection's default channel. Offered once Slack is connected; see [Slack](https://docs.truetask.io/integrations/slack). |
| **Slack** | A Slack incoming webhook URL. |
| **Microsoft Teams** | A Teams incoming webhook URL. |

A pasted webhook address works like a password, so only a workspace owner or admin can see or change it; anyone else sees that only an admin can.

Under **Events**, all fifteen are sent until you untick one: **PR opened**, **PR merged**, **PR closed**, **Review requested**, **PR approved**, **Changes requested**, **Issue opened**, **Issue closed**, **Issue reopened**, **CI failed**, **CI passed**, **CI started**, **Commit pushed**, **PR comment** and **Issue comment**.
**All events** goes back to sending everything.
The last line reports the last delivery and its HTTP status, so a broken channel is visible.

## Related

- [Git integration](https://docs.truetask.io/git/)
- [Branches, issues and pull requests](https://docs.truetask.io/git/tasks)
- [Code review](https://docs.truetask.io/git/code-review)
- [Board views](https://docs.truetask.io/boards/views)
