Custom actions
Custom actions are a preconfigured set of changes that are applied to a work package.
Currently, this resource is a stub. The conditions and changes defined for the custom action are not yet present in the resource.
Actions
Link | Description | Condition |
---|---|---|
executeImmediately | Apply the action to a work package |
Linked Properties
Property | Description | Type | Constraints | Supported operations |
---|---|---|---|---|
self | This custom action | CustomAction | not null | READ |
Local Properties
Property | Description | Type | Constraints | Supported operations |
---|---|---|---|---|
id | Custom action id | Integer | x > 0 | READ |
name | The user selected name of the custom action | String | READ | |
description | A text describing the custom action | String | READ |
Custom Action
- Parameters
- custom_action_id
integer
(required) Example: 1The id of the custom action to fetch
- Response
200
Toggle details Headers
Content-Type: application/hal+json
Body
{ "_type": "CustomAction", "name": "Change project and type", "description": "Changes project and type in one go", "_links": { "executeImmediately": { "href": "/apiChanges project and type in one go", "title": "Execute Change project and type", "method": "post" }, "self": { "href": "/api/v3/custom_actions/2", "title": "Change project and type" } } }
- Response
403
Toggle details Returned if the client does not have sufficient permissions.
Required permission: edit work packages in any project
Headers
Content-Type: application/hal+json
Body
{ "_type": "Error", "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission", "message": "You are not authorized to access this resource." }
- Response
404
Toggle details Returned if the custom action does not exist.
Headers
Content-Type: application/hal+json
Body
{ "_type": "Error", "errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound", "message": "The requested resource could not be found." }
Execute custom action
A POST to this end point executes the custom action on the work package provided in the payload. The altered work package will be returned. In order to avoid executing the custom action unbeknown to a change that has already taken place, the client has to provide the work package’s current lockVersion.
- Parameters
- custom_action_id
integer
(required) Example: 1The id of the custom action to execute
- Request
Execute custom action
Toggle details Headers
Content-Type: application/json
Body
{ "lockVersion": "3", "_links": { "workPackage": { "href": "/api/v3/work_packages/42" } } }
- Response
200
Toggle details Headers
Content-Type: application/hal+json
Body
Returns the work package resource that was updated. See [Work packages](work-packages) section for details.
- Response
400
Toggle details Occurs when the client did not send a valid JSON object in the request body.
Headers
Content-Type: application/hal+json
Body
{ "_type": "Error", "errorIdentifier": "urn:openproject-org:api:v3:errors:InvalidRequestBody", "message": "The request body was not a single JSON object." }
- Response
403
Toggle details Returned if the client does not have sufficient permissions.
Required permission: edit work packages - Additional permissions might be required based on the custom action.
Headers
Content-Type: application/hal+json
Body
{ "_type": "Error", "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission", "message": "You are not authorized to access this resource." }
- Response
404
Toggle details Returned if the custom action does not exist.
Headers
Content-Type: application/hal+json
Body
{ "_type": "Error", "errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound", "message": "The requested resource could not be found." }
- Response
409
Toggle details Returned if the client provided an outdated lockVersion or no lockVersion at all.
Headers
Content-Type: application/hal+json
Body
{ "_type": "Error", "errorIdentifier": "urn:openproject-org:api:v3:errors:UpdateConflict", "message": "Couldn't update the resource because of conflicting modifications." }
- Response
422
Toggle details Returned if the custom action was not executed successfully e.g. when a constraint on a work package property was violated.
Headers
Content-Type: application/hal+json
Body
{ "_type": "Error", "errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation", "message": "Delay must be a number greater than or equal to 0", "_embedded": { "details": { "attribute": "delay" } } }
Help and feedback
If you did not find what you were looking for
If you need help from the community or want to support others
If you are eligible for professional support and have more questions
REQUEST SUPPORT
If you find an easily fixable error or need for improvement in the documentation for the stable release
If you would like to suggest bigger updates or improvements to this documentation
If you want to contribute to translate this documentation to another language
If there's something you don't like or understand about this feature
If you want to propose a new feature that OpenProject does not offer yet
To further help OpenProject to shape and test new features
To view OpenProject premium features and pricing
If you want to try all premium features in the OpenProject Cloud Edition 14 days for free
If you want to try all premium features in your on premise Community installation 14 days for free