Link a work item to another
POSThttps://
Creates a link from the work item in the path to another work item in the same project, and returns it with a Location header pointing at the flat item path.
Access
- Token scope
- api:
write: project_management Without it:
403 insufficient-token-scope. - Permission
- project_management::
manage_work_items Without it:
403 insufficient-permission. - Rate cost
- 1 unit, write bucket. A write costs the same whatever
viewyou ask for. - Also
- Accepts
Idempotency-Key. Never cached:private, no-store. Unknown body keys are refused, never dropped.
Both are checked, scope first. A token never does more than its user. How access is checked
The body is exactly link_type and target_work_item_id: the source comes from the path, so source_work_item_id is not accepted, and created_by is the authenticated caller. To create the inverse of a relationship ("this item is blocked by ACM-9"), post to ACM-9's own collection instead: POST work-items/ACM-9/links with link_type=blocks and this item as the target stores the identical row, which both ends then read from their own side. Three refusals mirror plnnrly: a work item in another project is refused exactly as a nonexistent one is, linking an item to itself is 422 unprocessable-relationship, and repeating an existing (source, target, link_type) triple is 409 duplicate-resource.
Path parameters
Query parameters
Unknown parameters are refused with 400, naming the parameter.
Request headers
A correlation id of your own. It is recorded in our logs next to the server's request id but never returned: the response header always carries the server's id. A value that does not match the pattern is discarded silently, never rejected.
Request body
Unknown keys are refused with 422, naming the key.
The relationship, stored from the source item's point of view: blocks, clones, duplicates, merged_into, causes, relates_to or split_to. Only relates_to is symmetric.
blocks- The source cannot be finished until the target is, and the target is blocked by the source.
clones- The source was created as a copy of the target.
duplicates- The source and the target describe the same work; one of the two should be closed.
merged_into- The source was folded into the target, which now carries the work.
causes- The source is the cause of the target, typically a change that produced a defect.
relates_to- The two are related with no direction implied. This is the one symmetric type: it reads the same from either side.
split_to- The source was split and the target is one of the pieces it was split into.
New values may be added.
Work item the link points at. Always in the same project as the source.
Response 201
Returns a WorkItemLink in the detail view.
Headers
ETag- A strong validator of exactly this representation.
Idempotency-Replayedtruewhen this response was replayed from a storedIdempotency-Keyrather than produced by a new write.Location- The absolute URL of the created or queued resource.
RateLimit- The IETF
httpapi-ratelimit-headersform of your remaining allowance on the tightest bucket this request touched. RateLimit-Policy- The ceiling and window of that bucket, as
<limit>;w=<seconds>. X-Request-Id- The server-generated ULID correlating this response with our logs.
Every response also carries Cache-Control, Vary, X-Content-Type-Options, X-Plnnrly-Api-Version, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. Headers and versioning
Work item the link points away from. On a link created through POST work-items/{work_item}/links this is always the work item named in the path.
The relationship, stored from the source item's point of view: blocks, clones, duplicates, merged_into, causes, relates_to or split_to. Only relates_to is symmetric.
blocksclonesduplicatesmerged_intocausesrelates_tosplit_to
New values may be added.
User who created the link, or null where that account has since been deleted. Resolve it with GET /api/v2/users/{user}; it is not includable.
Which way this link points relative to the work item you asked about: forward when that item is the source, inverse when it is the target. On the flat GET work-item-links/{work_item_link} there is no work item in the path, so the link is read on its own terms and this is always forward.
The relationship in words, from the point of view of the work item you asked about: blocks from the source end, is blocked by from the target end. Always in English: the API pins the locale.
Work item the link points away from.
Work item the link points at.
Errors
415 Unsupported media type.
422 Unprocessable content.
7 errors every operation can return: 400, 401, 404, 406, 429, 500, 503
400 Bad request.
idempotency-key-requiredinvalid-cursorinvalid-query-parametermalformed-requestunsupported-parameter
401 Unauthenticated.
404 Not found.
406 Not acceptable.
429 Too many requests.
500 Server error.
503 Service unavailable.
This path allows GET, POST. Anything else answers 405.
Something wrong or missing on this page? Tell us