doc-locale/fr-fr/api/issue_links.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Utilisez cette API REST pour gérer les tickets liés.
Répertorie tous les tickets liés pour un ticket spécifié, triés par date et heure de création de la relation (ordre croissant). Les tickets sont filtrés en fonction des autorisations de l'utilisateur.
GET /projects/:id/issues/:issue_iid/links
Paramètres :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier ou chaîne de caractères | oui | L'ID ou le chemin encodé en URL du projet |
issue_iid | integer | oui | L'ID interne du ticket d'un projet |
[
{
"id" : 84,
"iid" : 14,
"issue_link_id": 1,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null,
"link_type": "relates_to",
"link_created_at": "2016-01-07T12:44:33.959Z",
"link_updated_at": "2016-01-07T12:44:33.959Z"
}
]
{{< history >}}
{{< /history >}}
Récupère les détails d'un lien de ticket spécifié.
GET /projects/:id/issues/:issue_iid/links/:issue_link_id
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier ou chaîne de caractères | Oui | L'ID ou le chemin encodé en URL du projet. |
issue_iid | integer | Oui | ID interne du ticket d'un projet. |
issue_link_id | entier ou chaîne de caractères | Oui | ID d'une relation entre tickets. |
Attributs du corps de la réponse :
| Attribut | Type | Description |
|---|---|---|
id | integer | ID du lien de ticket. |
source_issue | objet | Détails du ticket source de la relation. |
target_issue | objet | Détails du ticket cible de la relation. |
link_type | string | Type de la relation. Les valeurs possibles sont relates_to, blocks et is_blocked_by. |
Exemple de requête :
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/84/issues/14/links/1"
Exemple de réponse :
{
"id": 1,
"source_issue" : {
"id" : 83,
"iid" : 11,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"confidential": false,
"weight": null
},
"target_issue" : {
"id" : 84,
"iid" : 14,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null
},
"link_type": "relates_to"
}
{{< history >}}
id a été introduit dans GitLab 18.9.{{< /history >}}
Crée une relation bidirectionnelle entre deux tickets. L'utilisateur doit être autorisé à mettre à jour les deux tickets pour que l'opération réussisse.
POST /projects/:id/issues/:issue_iid/links
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier ou chaîne de caractères | oui | L'ID ou le chemin encodé en URL du projet |
issue_iid | integer | oui | L'ID interne du ticket d'un projet |
target_project_id | entier ou chaîne de caractères | oui | L'ID ou le chemin encodé en URL du projet d'un projet cible |
target_issue_iid | entier ou chaîne de caractères | oui | L'ID interne du ticket d'un projet cible |
link_type | string | non | Le type de la relation (relates_to, blocks, is_blocked_by), par défaut relates_to). |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/4/issues/1/links?target_project_id=5&target_issue_iid=1"
Exemple de réponse :
{
"id": 1,
"source_issue" : {
"id" : 83,
"iid" : 11,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"confidential": false,
"weight": null
},
"target_issue" : {
"id" : 84,
"iid" : 14,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null
},
"link_type": "relates_to"
}
{{< history >}}
id a été introduit dans GitLab 18.9.{{< /history >}}
Supprime un lien de ticket spécifié, en retirant la relation bidirectionnelle.
DELETE /projects/:id/issues/:issue_iid/links/:issue_link_id
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier ou chaîne de caractères | oui | L'ID ou le chemin encodé en URL du projet |
issue_iid | integer | oui | L'ID interne du ticket d'un projet |
issue_link_id | entier ou chaîne de caractères | oui | L'ID d'une relation entre tickets |
link_type | string | non | Le type de la relation (relates_to, blocks, is_blocked_by), par défaut relates_to |
{
"id": 1,
"source_issue" : {
"id" : 83,
"iid" : 11,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"confidential": false,
"weight": null
},
"target_issue" : {
"id" : 84,
"iid" : 14,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null
},
"link_type": "relates_to"
}