Content
You are here:
How to get cost reports (API)
Added by masayuki ogawa 10 months ago
I want to get a breakdown of the work hours registered in work_packages.
For example, for work_package with id 24235, I received the following json from endpoint /api/v3/work_packages/24235
curl -X 'GET' \
'https://{MY_HOST_URL}/api/v3/work_packages/24235' \
-H 'accept: application/hal+json' \
-H 'X-Requested-With: XMLHttpRequest'
{
... snip ...
"spentTime": "PT7H45M",
... snip ...
"_links": {
... snip ...
"showCosts": {
"href": "/projects/13/cost_reports?fields%5B%5D=WorkPackageId&operators%5BWorkPackageId%5D=%3D&set_filter=1&values%5BWorkPackageId%5D=24235",
"type": "text/html",
"title": "Show cost entries"
},
... snip ...
}
Is the showCosts href valid in this case? When I try to access it, I get a 404 not found. Why is this? Can I get a breakdown of the work hours ?
Replies (1)
Supplement: I would like to use the API to do the following
https://www.openproject.org/docs/user-guide/time-and-costs/reporting/#time-and-costs-reports