​

Update planned relation

PATCH
https://example.kaiten.ru/api/latest/cards/{card_id}/planned-relation/{id}

Changes the type or the gap of a relation. Fields that are not sent keep their values. To set a gap on a relation without one, send gap and gap_type together; to clear the gap, send both as null. After the change, the successor is moved so that its linked date equals the predecessor's linked date plus the gap, and keeps its working duration. If the successor has other predecessors, it is placed by the one that requires the latest date. A completed successor (state 3) or a successor with ignore_planned_dates_recalculation is not moved, but the change is saved.

Path parameters
NameTypeReference
card_idrequiredintegerPredecessor card ID
idrequiredintegerSuccessor card ID
Headers
NameValue
Content-Typeapplication/json
Attributes
schema
NameTypeConstraintsDescription
type
enum
[
  end-start,
  start-start,
  end-end,
  start-end
]

Which dates are linked, predecessor's date first: end-start: the successor starts when the predecessor ends (finish-to-start) start-start: the successor starts when the predecessor starts (start-to-start) end-end: the successor ends when the predecessor ends (finish-to-finish) start-end: the successor ends when the predecessor starts (start-to-finish) The gap is kept when the type changes

gap
integer
minimum: -1000
maximum: 1000

Offset of the successor's linked date from the predecessor's linked date, in gap_type units. Counted in working time: non-working days and hours are skipped. A negative value moves the successor earlier. When the successor's dates are changed directly, the gap is recalculated to the new distance

null

No gap. Send together with gap_type: null to clear the gap

gap_type
enum
[hours,days]

Gap unit

null

No gap. Send together with gap: null

Responses

200
DescriptionResponse typeExample
SuccessObject
Open
Response Attributes
NameTypeDescription
source_id

integer

Predecessor card ID
target_id

integer

Successor card ID
type

string

Relation type: end-start, start-start, end-end or start-end
gap

null | integer

Gap in gap_type units, null if the relation has no gap
gap_type

null | string

Gap unit: hours or days, null if the relation has no gap
author_id

integer

ID of the user who created the relation
400
DescriptionResponse typeExample
Validation error: unknown type, gap out of range, no fields sent, null sent for only one of gap and gap_type, or only one of gap and gap_type sent for a relation without a gap. also returned with code 53 when moving the successor would shift too many linked cards; nothing is changed in this caseObject
Open
Response Attributes
NameTypeDescription
message

string

Error message
code

integer

53 when too many linked cards would be shifted
401
DescriptionResponse typeExample
Invalid tokenString
Open
402
DescriptionResponse typeExample
The tariff does not include the gantt and resource planning featureObject
Open
Response Attributes
NameTypeDescription
message

string

Error message
featurePath

string

Missing tariff feature
403
DescriptionResponse typeExample
The user cannot edit one of the cards, the relation does not exist, or a card that has to be moved is locked by an asynchronous operation (code 20)ObjectResponse body does not exist
Response Attributes
NameTypeDescription
code

integer

20 when a card is locked by an asynchronous operation
locked_entity

string

card when a card is locked by an asynchronous operation
message

string

Error message when a card is locked by an asynchronous operation
Examples

Change the relation type, the gap is kept

{
  "type": "end-end"
}

Set a gap of 2 working days

{
  "gap": 2,
  "gap_type": "days"
}

Clear the gap

{
  "gap": null,
  "gap_type": null
}
logo
Kaiten
If you have any questions or need help with integration feel free to write us at support@kaiten.ru

Path Parameters

  1  curl --request PATCH \
  2       --url 'https://example.kaiten.ru/api/latest/cards/{card_id}/planned-relation/{id}' \
  3       --header 'Accept: application/json' \
  4       --header 'Content-Type: application/json'
  5      

Response

ClickTry It!to start a request and see the response here!