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

Unable to assign ticket type when creating #6

Closed
menachemkorf opened this issue Jul 9, 2020 · 5 comments
Closed

Unable to assign ticket type when creating #6

menachemkorf opened this issue Jul 9, 2020 · 5 comments

Comments

@menachemkorf
Copy link

Description
When creating a ticket using the api bundle it gets the default ticket type even when sending a type field with the request.

How to reproduce
Create two Ticket Types in the dashboard

  • default
  • support

Send a POST request to my-domain/api/v1/ticket with

{
    "name": "John Dow",
    "from": "john@example.com",
    "subject": "Example",
    "message": "Testing example.",
    "type": "support"
}

The newly created ticket has the default ticket type.

Possible Cause
In Webkul\UVDesk\ApiBundle\API\Tickets::createTicket we don't do anything with $data['type']

@papnoisanjeev
Copy link
Contributor

@menachemkorf

https://github.com/uvdesk/api-bundle/blob/master/API/Tickets.php#L217

Add "type" in this array and make a try.

@menachemkorf
Copy link
Author

@papnoisanjeev no, adding 'type' to $extraKeys didn't work,

I fixed it by adding the following code to the create function

if (array_key_exists('type', $data)) {
    $ticketType = $entityManager->getRepository('UVDeskCoreFrameworkBundle:TicketType')->findOneByCode($data['type']);

    $ticketData['type'] = $ticketType;
}

@papnoisanjeev
Copy link
Contributor

@menachemkorf

Glad to know that it is working for you !!
We will also add ticket type in next release.

@menachemkorf
Copy link
Author

menachemkorf commented Aug 13, 2020

@papnoisanjeev Any idea when this will happen?

@papnoisanjeev
Copy link
Contributor

@menachemkorf

Most probably end of this month or may be first or second week of next month.
As we will try to add some new more APIs in next release.

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

No branches or pull requests

2 participants