* rename timestamps on time entry
* add updated_at filter/order for time entries
* rename on cost entries as well
This will make handling in the cost query easier
* adapt specs
* linting
* adapt project activity
* update references to updated_on
@ -33,7 +33,7 @@ Time entries are either linked to a work package or to a project. If they are li
Depending on custom fields defined for time entries, additional properties might exist.
## Time entry [/api/v3/time_entries/{id}]
## View time entry [/api/v3/time_entries/{id}]
+ Model
+ Body
@ -106,7 +106,7 @@ Depending on custom fields defined for time entries, additional properties might
+ Response 200 (application/hal+json)
[Time entry][]
[View time entry][]
+ Response 404 (application/hal+json)
@ -122,6 +122,183 @@ Depending on custom fields defined for time entries, additional properties might
"message": "The requested resource could not be found."
}
## Create time entry [/api/v3/time_entries]
## Create Time entry [POST]
Creates a new time entry applying the attributes provided in the body. Please note that while there is a fixed set of attributes, custom fields can extend a time entries' attributes and are accepted by the endpoint.
+ Request Create time entry
+ Body
{
"_links": {
"project": {
"href": "/api/v3/projects/34"
},
"activity": {
"href": "/api/v3/time_entries/activities/18"
},
"workPackage": {
"href": "/api/v3/work_packages/5"
},
"customField4": {
"href": "/api/v3/users/5"
},
"customField51": {
"href": "/api/v3/custom_options/11"
}
},
"hours": 'PT5H',
"comment": {
"raw": "Some comment"
},
"spentOn": "2017-07-28",
"customField1": {
"raw": "some text custom field value"
},
"customField8": 5
}
+ Response 201
[View time entry][]
+ Response 400 (application/hal+json)
Occurs when the client did not send a valid JSON object in the request body.
Updates the given time entry by applying the attributes provided in the body. Please note that while there is a fixed set of attributes, custom fields can extend a time entries' attributes and are accepted by the endpoint.
+ Parameters
+ id (required, integer, `1`) ... Time entry id
+ Request Update time entry
+ Body
{
"_links": {
"activity": {
"href": "/api/v3/time_entries/activities/18"
},
"workPackage": {
"href": "/api/v3/work_packages/5"
},
"customField4": {
"href": "/api/v3/users/5"
},
"customField51": {
"href": "/api/v3/custom_options/11"
}
},
"hours": "PT5H",
"comment": {
"raw": "Some comment"
},
"spentOn": "2017-07-28",
"customField1": {
"raw": "some text custom field value"
},
"customField8": 5
}
+ Response 200
[View time entry][]
+ Response 400 (application/hal+json)
Occurs when the client did not send a valid JSON object in the request body.
Accepts the same format as returned by the [queries](#queries) endpoint. Currently supported filters are:
@ -302,12 +480,13 @@ Lists time entries. The time entries returned depend on the filters provided and
+ project: Filter time entries by project
+ user: Filter time entries by users
+ spent_on: Filter time entries by spent on date
+ created_on: Filter time entries by creation datetime
+ created_at: Filter time entries by creation datetime
+ updated_at: Filter time entries by the last time they where updated
+ activity: Filter time entries by time entry activity
+ Response 200 (application/hal+json)
[Time entries][]
[List time entries][]
+ Response 400 (application/hal+json)
@ -335,180 +514,7 @@ Lists time entries. The time entries returned depend on the filters provided and
"message": "You are not authorized to view this resource."
}
## Create Time entry [POST]
Creates a new time entry applying the attributes provided in the body. Please note that while there is a fixed set of attributes, custom fields can extend a time entries' attributes and are accepted by the endpoint.
+ Parameters
+ Request Create time entry
+ Body
{
"_links": {
"project": {
"href": "/api/v3/projects/34"
},
"activity": {
"href": "/api/v3/time_entries/activities/18"
},
"workPackage": {
"href": "/api/v3/work_packages/5"
},
"customField4": {
"href": "/api/v3/users/5"
},
"customField51": {
"href": "/api/v3/custom_options/11"
}
},
"hours": 'PT5H',
"comment": {
"raw": "Some comment"
},
"spentOn": "2017-07-28",
"customField1": {
"raw": "some text custom field value"
},
"customField8": 5
}
+ Response 201
[Time entry][]
+ Response 400 (application/hal+json)
Occurs when the client did not send a valid JSON object in the request body.
Updates the given time entry by applying the attributes provided in the body. Please note that while there is a fixed set of attributes, custom fields can extend a time entries' attributes and are accepted by the endpoint.
+ Parameters
+ Request Update time entry
+ Body
{
"_links": {
"activity": {
"href": "/api/v3/time_entries/activities/18"
},
"workPackage": {
"href": "/api/v3/work_packages/5"
},
"customField4": {
"href": "/api/v3/users/5"
},
"customField51": {
"href": "/api/v3/custom_options/11"
}
},
"hours": "PT5H",
"comment": {
"raw": "Some comment"
},
"spentOn": "2017-07-28",
"customField1": {
"raw": "some text custom field value"
},
"customField8": 5
}
+ Response 200
[Time entry][]
+ Response 400 (application/hal+json)
Occurs when the client did not send a valid JSON object in the request body.