Logging time on a tracker item
Requirements
To enable the time tracking feature of codeBeamer you need to have a Time Recording type tracker in your project:
Logging
To log time on an item you need to create a new tracker item in your Time Recording tracker having the target tracker item as subject.
Use the following endpoint:
POST /v2/tracker/{trackerId}/item - where trackerId is the id of the Time Recording tracker
With the following request body:
{
"name": "My late work log", // Name of the activity
"description": "--",
"descriptionFormat": "PlainText",
"status": {
"fieldId": 7, // Recorded status
"type": "SingleOptionChoiceFieldValue",
"value": 1
},
"startDate": "2019-09-10T22:00:00", // Time of the work log
"priority": {
"fieldId": 2, // Type of the work log (Analysis, Design, Test, etc.)
"type": "SingleOptionChoiceFieldValue",
"value": 13
},
"subjects": {
"fieldId": 17, // Reference to the item to log time on
"type": "TrackerItemChoiceFieldValue",
"values": [ 1055 ]
},
"customFieldValues": [
{
"fieldId": 11, // Spent effort in milliseconds
"type": "DurationFieldValue",
"value": 30000
}
]
}
Work log types
To find out what kind of work log types are in the system use the following REST call.
Endpoint:
GET /v2/tracker/{trackerId}/field/2 - where trackerId is the id of the Time Recording tracker
Example result:
{
"id": 2,
"name": "Kind",
"type": "OptionChoiceField",
"hidden": false,
"multipleValues": false,
"options": [
{
"id": 10,
"uri": "/tracker/3237/field/2/option/10",
"name": "Analysis",
"type": "ChoiceOptionReference"
},
{
"id": 11,
"uri": "/tracker/3237/field/2/option/11",
"name": "Design",
"type": "ChoiceOptionReference"
},
{
"id": 12,
"uri": "/tracker/3237/field/2/option/12",
"name": "Implementation",
"type": "ChoiceOptionReference"
},
{
"id": 13,
"uri": "/tracker/3237/field/2/option/13",
"name": "Test",
"type": "ChoiceOptionReference"
},
{
"id": 14,
"uri": "/tracker/3237/field/2/option/14",
"name": "Approval",
"type": "ChoiceOptionReference"
},
{
"id": 15,
"uri": "/tracker/3237/field/2/option/15",
"name": "Administration",
"type": "ChoiceOptionReference"
},
{
"id": 16,
"uri": "/tracker/3237/field/2/option/16",
"name": "Organisation",
"type": "ChoiceOptionReference"
},
{
"id": 99,
"uri": "/tracker/3237/field/2/option/99",
"name": "Other",
"type": "ChoiceOptionReference"
}
]
}