GET

Get required-builds latest projects {projectKey} repos {repositorySlug} conditions

Returns a page of required build merge checks that have been configured for this repository.

The authenticated user must have REPO_READ permission for the target repository to request a page of required build merge checks.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

The required build merge checks associated with the provided repository.

application/json

object
GET/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/conditions
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/conditions' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 { "values": [ { "buildParentKeys": [ "build-key-1", "build-key-2" ], "refMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "exemptRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 15 } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put required-builds latest projects {projectKey} repos {repositorySlug} condition {id}

Update the required builds merge check for the given ID.

The authenticated user must have REPO_ADMIN permission for the target repository to update a required build merge check.

The contents of the required build merge check request are:

These fields are required:

  • buildParentKeys: A non-empty list of build parent keys that require green builds for this merge check to pass
  • refMatcher.id: The value to match refs against in the target branch
  • refMatcher.type.id: The type of ref matcher, one of: "ANY_REF", "BRANCH", "PATTERN", "MODEL_CATEGORY" or "MODEL_BRANCH"

These fields are optional:

  • exemptRefMatcher.id The value to exempt refs in the source branch from this check
  • exemptRefMatcher.type.id: The type of exempt ref matcher, one of: "ANY_REF", "BRANCH", "PATTERN", "MODEL_CATEGORY" or "MODEL_BRANCH"

Request

Path parameters

projectKey

string

Required
id

integer

Required
repositorySlug

string

Required

Request body*/*

The request specifying the required build parent keys, ref matcher and exemption matcher

buildParentKeys

array<string>

Required
exemptRefMatcher

RestRefMatcher

refMatcher

object

Required

Responses

The details needed to update a required build merge check.

application/json

RestRequiredBuildCondition
PUT/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "buildParentKeys": [ "build-key-1", "build-key-2" ], "refMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "exemptRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 15 }
DEL

Delete required-builds latest projects {projectKey} repos {repositorySlug} condition {id}

Deletes a required build existing merge check, given it's ID.

The authenticated user must have REPO_ADMIN permission for the target repository to delete a required build merge check.

Request

Path parameters

projectKey

string

Required
id

integer

Required
repositorySlug

string

Required

Responses

An empty response indicating the merge check was successfully deleted, or was never present.

DEL/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}'
POST

Post required-builds latest projects {projectKey} repos {repositorySlug} condition

Create a required build merge check for the given repository.

The authenticated user must have REPO_ADMIN permission for the target repository to register a required build merge check.

The contents of the required build merge check request are:

These fields are required:

  • buildParentKeys: A non-empty list of build parent keys that require green builds for this merge check to pass
  • refMatcher.id: The value to match refs against in the target branch
  • refMatcher.type.id: The type of ref matcher, one of: "ANY_REF", "BRANCH", "PATTERN", "MODEL_CATEGORY" or "MODEL_BRANCH"

These fields are optional:

  • exemptRefMatcher.id The value to exempt refs in the source branch from this check
  • exemptRefMatcher.type.id: The type of exempt ref matcher, one of: "ANY_REF", "BRANCH", "PATTERN", "MODEL_CATEGORY" or "MODEL_BRANCH"

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request body*/*

The request specifying the required build parent keys, ref matcher and exemption matcher

buildParentKeys

array<string>

Required
exemptRefMatcher

RestRefMatcher

refMatcher

object

Required

Responses

A response containing the newly created required build merge check.

application/json

RestRequiredBuildCondition
POST/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/condition
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/required-builds/latest/projects/{projectKey}/repos/{repositorySlug}/condition' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "buildParentKeys": [ "build-key-1", "build-key-2" ], "refMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "exemptRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 15 }

Rate this page: