POST /rest/delegation/1.0/api/delegation

Creates a new delegation record using the data provided in the request body.

Request

<jira_url>/rest/delegation/1.0/api/delegation

The request takes all parameters from the request body.

The request expects a body (payload) in the json format shown below

{
    "active": true,
    "delegator": "user1",
    "delegates": [
        "user2"
    ],
    "categoryIds": [
        2
    ],
    "startDate": "2024-12-18T21:00+03:00",
    "endDate": "2024-12-25T21:00+03:00",
    "notes": "Delegation set for holiday coverage"
}


Parameters

Parameter

Description

LocationRequired

Value Samples

activeIndicates whether the delegation configuration is currently active.Request BodyYes
  • true
  • false
delegator

The Jira username of the user whose delegates are being configured.

The authenticated user must have View & Edit All Delegations permission to create a delegation for other users.

See DEL v1.5 - Permissions

Request BodyYesuser1
delegatesA list of Jira usernames that are delegated to.Request BodyYes["user1", "user2"]
categoryIds

A list of category IDs assigned to the delegation configuration.

If not specified the general category will be used.

Id of all categories can be retrieved using DEL v1.5 - Get Categories endpoint.

Request BodyNo[1, 2]
startDateThe start date/time for the delegation in ISO 8601 format with timezone offset.Request BodyYes2024-12-18T21:00+03:00
endDateThe end date/time for the delegation in ISO 8601 format with timezone offset.Request BodyYes2024-12-25T21:00+03:00
notesAdditional notes related to the delegation configuration.Request BodyNoDelegation set for holiday coverage

Examples

https://192.168.0.1/rest/delegation/api/1.0/delegation
{
    "active": true,
    "delegator": "user1",
    "delegates": [
		"user2"
	],
    "categoryIds": [
		2
	],
    "startDate": "2024-12-18T21:00+03:00",
    "endDate": "2024-12-25T21:00+03:00",
    "notes": "Delegation set for holiday coverage"
}

https://192.168.0.1/rest/delegation/api/1.0/delegation
{
    "active": false,
    "delegator": "admin",
    "delegates": [
        "user"
    ],
    "startDate": "2024-12-18T21:00Z",
    "endDate": "2024-12-25T21:00Z"
}

Responses

Success

HTTP 200

Returns the new delegation record as JSON.

{
    "delegationId": 110,
    "version": 1,
    "active": true,
    "delegator": "user1",
    "delegates": [
        "user2"
    ],
    "categoryIds": [],
    "startDate": "2024-12-18T21:00+03:00",
    "endDate": "2024-12-25T21:00+03:00",
    "notes": "Delegation set for holiday coverage"
}

Invalid Parameter

HTTP 400

When one of the required parameters is missing or one of the supplied parameter values is invalid.

{
    "status": 400,
    "message": "Delegator is required.",
    "timestamp": "2024-12-20 07:43:40 +0000",
    "errors": {
        "delegator": "Delegator is required."
    }
}
{
    "status": 400,
    "message": "Notes cannot exceed 2000 characters.",
    "timestamp": "2024-12-20 08:36:42 +0000",
    "errors": {
        "notes": "Notes cannot exceed 2000 characters."
    }
}

Missing Permission

HTTP 403

When the authenticated user does not have the necessary permissions.

{
    "status": 403,
    "message": "You do not have permission to modify delegations.",
    "timestamp": "2024-12-20 07:44:05 +0000"
}

Not Found

HTTP 404

When one of the supplied parameter values is not found.

{
    "status": 404,
    "message": "Category with id \"123\" could not be found.",
    "timestamp": "2024-12-20 08:15:44 +0000"
}



  • No labels