Open link in a new tab

Content

Expand project menu

How to get cost reports (API)

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 ?

Message actions