API: Time entry activities

Time entries are classified by an activity which is one item of a set of user defined activities (e.g. Design, Specification, Development).

Actions

None

Linked Properties

Link Description Type Constraints Supported operations Condition
self This time entry activity TimeEntriesActivity not null READ
projects List of projects the time entry is active in []Project not null READ / WRITE

Local Properties

Property Description Type Constraints Supported operations Condition
id Time entries’ id Integer x > 0 READ
name The human readable name chosen for this activity String max 30 characters READ
position The rank the activity has in a list of activities Date READ  
default Flag to signal whether this activity is the default activity Boolean READ  

Methods

View time entries activity

Fetches the time entry activity resource by the given id.

id
integer

required path

Time entries activity id

Example:
1

200

OK

{
  "_type": "TimeEntriesActivity",
  "id": 18,
  "name": "Management",
  "position": 8,
  "default": false,
  "_embedded": {
    "projects": [

    ]
  },
  "_links": {
    "self": {
      "href": "/api/v3/time_entries/activities/18",
      "title": "Management"
    },
    "projects": [
      {
        "href": "/api/v3/projects/death_star_v2",
        "title": "DeathStarV2"
      },
      {
        "href": "/api/v3/projects/star_killer_base",
        "title": "StarKillerBase"
      }
    ]
  }
}
TimeEntryActivityModel
{
  "type": "object",
  "required": [
    "_type",
    "id",
    "name",
    "position",
    "default",
    "_embedded",
    "_links"
  ],
  "properties": {
    "_type": {
      "type": "string",
      "enum": [
        "TimeEntriesActivity"
      ]
    },
    "id": {
      "type": "integer",
      "description": "Time entry id",
      "minimum": 1
    },
    "name": {
      "type": "string",
      "description": "The human readable name chosen for this activity"
    },
    "position": {
      "type": "integer",
      "description": "The rank the activity has in a list of activities"
    },
    "default": {
      "type": "boolean",
      "description": "Flag to signal whether this activity is the default activity"
    },
    "_embedded": {
      "type": "object",
      "required": [
        "projects"
      ],
      "properties": {
        "projects": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/ProjectModel"
          }
        }
      }
    },
    "_links": {
      "type": "object",
      "required": [
        "self",
        "projects"
      ],
      "properties": {
        "self": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Link"
            },
            {
              "description": "This time entry activity\n\n**Resource**: TimeEntriesActivity"
            }
          ]
        },
        "projects": {
          "type": "array",
          "items": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Link"
              },
              {
                "description": "One of the projects the time entry is active in.\n\n**Resource**: Project"
              }
            ]
          }
        }
      }
    }
  },
  "examples": [
    {
      "_type": "TimeEntriesActivity",
      "id": 18,
      "name": "Management",
      "position": 8,
      "default": false,
      "_embedded": {
        "projects": [

        ]
      },
      "_links": {
        "self": {
          "href": "/api/v3/time_entries/activities/18",
          "title": "Management"
        },
        "projects": [
          {
            "href": "/api/v3/projects/death_star_v2",
            "title": "DeathStarV2"
          },
          {
            "href": "/api/v3/projects/star_killer_base",
            "title": "StarKillerBase"
          }
        ]
      }
    }
  ]
}

404

Returned if the activity does not exist or if the user does not have permission to view them.

Required permission view time entries, log time, edit time entries, edit own time entries or manage project activities in any project

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound",
  "message": "The requested resource could not be found."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}