Content
You are here:
Python: How to set Type when creating work package using v3/projects/{id}/work_packages API?
Added by Eric Chan over 1 year ago
as you can see when I include type 'Bug' in the request body, I'll hit the below error, when I exclude it the API works fine:
{'_type': 'Error', 'errorIdentifier': 'urn:openproject-org:api:v3:errors:InternalServerError', 'message': 'An internal error has occurred. undefined method `fetch\' for "Bug":String\n\n hash.fetch("_embedded", []).each { |name, fragment| hash[name] = fragment }\n ^^^^^^'}
Replies (1)
Type
is a linked property, see API documentation, and needs to be handled as such.That means you will need to refer to the type with a path like `/api/v3/types/1`. In your Python dict, this should be passed as