Add Batch Defect Groups Links

Request

POST

https://appsec.sourcecraft.tech/v1/defect-groups/links/batch

Query parameters

Name

Description

gitRepo

Type: string

Repository identifier. Accepts either internal repository ID (e.g., 88769874964302633) or public UUID (e.g., 0199140f-4343-7c06-a7e3-b835c305b629). These values can be obtained from the getRepo API (fields: id and uuid).

Pattern: \S

Example: 0199140f-4343-7c06-a7e3-b835c305b629

Body

application/json
{
  "updates": [
    {
      "defectGroupUuid": "0199140f-4343-7c06-a7e3-b835c305b629",
      "links": [
        {
          "type": "SOURCECRAFT_PR",
          "identifier": "42"
        }
      ]
    }
  ]
}

Name

Description

updates

Type: DefectGroupLinksUpdate[]

Min items: 1

Example
[
  {
    "defectGroupUuid": "0199140f-4343-7c06-a7e3-b835c305b629",
    "links": [
      {
        "type": "SOURCECRAFT_PR",
        "identifier": "42"
      }
    ]
  }
]

LinkType

Type: string

Enum: EXTERNAL_URL, SOURCECRAFT_ISSUE, SOURCECRAFT_PR, YA_TRACKER

LinkToAdd

Name

Description

identifier

Type: string

Platform ID of the issue or pull request (a number or a UUID), or the HTTPS URL for URL-typed links

Pattern: \S

Example: 42

type

Type: string

Link type. SOURCECRAFT_ISSUE and SOURCECRAFT_PR carry a platform identifier, EXTERNAL_URL and YA_TRACKER carry an HTTPS URL.

Enum: EXTERNAL_URL, SOURCECRAFT_ISSUE, SOURCECRAFT_PR, YA_TRACKER

Example
{
  "type": "SOURCECRAFT_PR",
  "identifier": "42"
}

DefectGroupLinksUpdate

Name

Description

defectGroupUuid

Type: string

UUID of the defect group to attach the links to

Pattern: \S

Example: 0199140f-4343-7c06-a7e3-b835c305b629

links

Type: LinkToAdd[]

Min items: 1

Example
[
  {
    "type": "SOURCECRAFT_PR",
    "identifier": "42"
  }
]
Example
{
  "defectGroupUuid": "0199140f-4343-7c06-a7e3-b835c305b629",
  "links": [
    {
      "type": "SOURCECRAFT_PR",
      "identifier": "42"
    }
  ]
}

Responses

200 OK

OK

Body

application/json
{
  "inserted": 0
}

Name

Description

inserted

Type: integer

Links actually inserted; already existing ones and links for defect groups missing from this repository are skipped

400 Bad Request

Bad Request

Previous