Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest API Error on Ticket Create Request #98

Closed
1 of 2 tasks
cydefend opened this issue Oct 19, 2018 · 2 comments
Closed
1 of 2 tasks

Rest API Error on Ticket Create Request #98

cydefend opened this issue Oct 19, 2018 · 2 comments

Comments

@cydefend
Copy link

Is this a BUG REPORT or FEATURE REQUEST?:

  • BUG
  • FEATURE

What happened: A Rest call POST to /api/v1/tickets/create seems to fail with an error message. This occurred on a fresh ubuntu 16.04 using the provided install script.

"reason": {
"message": "Cast to ObjectId failed for value "1" at path "priority"",
"name": "CastError",
"stringValue": ""1"",
"kind": "ObjectId",
"value": 1,
"path": "priority"
}

What did you expect to happen: Following the api, I expected a success true response with the details of the ticket.

How to reproduce it (as minimally and precisely as possible):

POST /api/v1/tickets/create HTTP/1.1
Host: 10.30.40.20:8118
accesstoken: 39a5d074f21cf8f8dcdbcb6d7813b6d41725ae86
Content-Type: application/json
Cache-Control: no-cache

{ "subject": "Subject", "issue": "Issue Exmaple", "owner": "5bc76a3691e47d435efe1f3d", "group":"5bc76a3691e47d435efe1f3c", "type": "5bc76a3d9b88fb44b00a7e5a", "priority": 1 }

Anything else we need to know?:

Environment:

  • Trudesk Version: Trudesk version 1.0.1
  • OS (e.g. from /etc/os-release): Ubuntu 16.04
  • Node.JS Version: v10.12.0
  • MongoDB Version: db version v3.6.8
  • Is this hosted on cloud.trudesk.io: no
@polonel
Copy link
Owner

polonel commented Oct 19, 2018

This is confirmed. It's also a breaking change in the documentation that needs updating as well.
The issue comes from priorities are no longer hardcoded and customizable and the priority field now takes a priority ObjectID.

You can get the priority _id from a GET call to /api/v1/tickets/priorities

Working on fix now

@cydefend
Copy link
Author

Using the priority _id worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants