API: Priorities

Linked Properties

Link Description Type Constraints Supported operations
self This priority Priority not null READ

Local Properties

Property Description Type Constraints Supported operations
id Priority id Integer x > 0 READ
name Priority name String not empty READ
position Sort index of the priority Integer x > 0 READ
isDefault Indicates whether this is the default value Boolean   READ
isActive Indicates whether the priority is available Boolean   READ

Methods

List all priorities

No parameters

200

OK

{
  "_embedded": {
    "elements": [
      {
        "_links": {
          "self": {
            "href": "/api/v3/priorities/1",
            "title": "Low"
          }
        },
        "_type": "Priority",
        "id": 1,
        "isActive": true,
        "isDefault": false,
        "name": "Low",
        "position": 1
      },
      {
        "_links": {
          "self": {
            "href": "/api/v3/priorities/2",
            "title": "Normal"
          }
        },
        "_type": "Priority",
        "id": 2,
        "isActive": true,
        "isDefault": true,
        "name": "Normal",
        "position": 2
      },
      {
        "_links": {
          "self": {
            "href": "/api/v3/priorities/3",
            "title": "High"
          }
        },
        "_type": "Priority",
        "id": 3,
        "isActive": true,
        "isDefault": false,
        "name": "High",
        "position": 3
      },
      {
        "_links": {
          "self": {
            "href": "/api/v3/priorities/4",
            "title": "Immediate"
          }
        },
        "_type": "Priority",
        "id": 4,
        "isActive": true,
        "isDefault": false,
        "name": "Immediate",
        "position": 5
      }
    ]
  },
  "_links": {
    "self": {
      "href": "/api/v3/priorities"
    }
  },
  "_type": "Collection",
  "count": 4,
  "total": 4
}

PrioritiesModel

{
  "type": "object",
  "example": {
    "_links": {
      "self": {
        "href": "/api/v3/priorities"
      }
    },
    "_type": "Collection",
    "total": 4,
    "count": 4,
    "_embedded": {
      "elements": [
        {
          "_type": "Priority",
          "_links": {
            "self": {
              "href": "/api/v3/priorities/1",
              "title": "Low"
            }
          },
          "id": 1,
          "name": "Low",
          "position": 1,
          "isDefault": false,
          "isActive": true
        },
        {
          "_type": "Priority",
          "_links": {
            "self": {
              "href": "/api/v3/priorities/2",
              "title": "Normal"
            }
          },
          "id": 2,
          "name": "Normal",
          "position": 2,
          "isDefault": true,
          "isActive": true
        },
        {
          "_type": "Priority",
          "_links": {
            "self": {
              "href": "/api/v3/priorities/3",
              "title": "High"
            }
          },
          "id": 3,
          "name": "High",
          "position": 3,
          "isDefault": false,
          "isActive": true
        },
        {
          "_type": "Priority",
          "_links": {
            "self": {
              "href": "/api/v3/priorities/4",
              "title": "Immediate"
            }
          },
          "id": 4,
          "name": "Immediate",
          "position": 5,
          "isDefault": false,
          "isActive": true
        }
      ]
    }
  }
}

403

Returned if the client does not have sufficient permissions.

Required permission: view work package (on any project)

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
  "message": "You are not allowed to see the priorities."
}

View priority

id
integer

required path

Priority id

Example:
1

200

OK

{
  "_links": {
    "self": {
      "href": "/api/v3/priorities/1",
      "title": "Low"
    }
  },
  "_type": "Priority",
  "id": 1,
  "isActive": true,
  "isDefault": false,
  "name": "Low",
  "position": 1
}

PriorityModel

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Priority id",
      "readOnly": true,
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "name": {
      "type": "string",
      "description": "Priority name",
      "readOnly": true,
      "minLength": 1
    },
    "position": {
      "type": "integer",
      "description": "Sort index of the priority",
      "readOnly": true,
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "isDefault": {
      "type": "boolean",
      "description": "Indicates whether this is the default value",
      "readOnly": true
    },
    "isActive": {
      "type": "boolean",
      "description": "Indicates whether the priority is available"
    },
    "_links": {
      "type": "object",
      "required": [
        "self"
      ],
      "properties": {
        "self": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "This priority\n\n**Resource**: Priority",
              "readOnly": true
            }
          ]
        }
      }
    }
  },
  "example": {
    "_type": "Priority",
    "_links": {
      "self": {
        "href": "/api/v3/priorities/1",
        "title": "Low"
      }
    },
    "id": 1,
    "name": "Low",
    "position": 1,
    "isDefault": false,
    "isActive": true
  }
}

403

Returned if the client does not have sufficient permissions.

Required permission: view work package (on any project)

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
  "message": "You are not allowed to see this priority."
}