# link_ticket_pull_request

`tools/call` · `POST /clanker/v1/tickets:link-pull-request`

Link a GitHub pull request to a ticket, so the ticket page lists it and Review and Ship merge and follow it. Link the pull request you open for a ticket as soon as gh pr create prints its link; work in several repositories links one per repository. Linking one the ticket already has changes nothing. A ticket links up to 10. Returns the ticket. Needs write access.

- Area: Planning
- Needs the write grant. Idempotent.

## Inputs

- `ticket` (string, required): A ticket ID, such as WEB-31.
- `pullRequest` (string, required): A github.com pull request, by its link, such as https://github.com/acme/web/pull/142, or as owner/name#number, such as acme/web#142.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "link_ticket_pull_request",
    "arguments": {
      "ticket": "WEB-31",
      "pullRequest": "https://github.com/acme/web/pull/142"
    }
  }
}
```

## HTTP request

The same call over the clanker HTTP API, with a clanker OAuth access token:

```bash
curl -X POST https://api.clankership.com/clanker/v1/tickets:link-pull-request \
  -H "Authorization: Bearer $CLANKER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": "WEB-31",
    "pullRequest": "https://github.com/acme/web/pull/142"
  }'
```
