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

API creates empty tickets without articles if data is missing #2421

Closed
alex-LE opened this issue Jan 3, 2019 · 4 comments
Closed

API creates empty tickets without articles if data is missing #2421

alex-LE opened this issue Jan 3, 2019 · 4 comments

Comments

@alex-LE
Copy link

alex-LE commented Jan 3, 2019

Infos:

  • Used Zammad version: 2.8.x
  • Installation method: package
  • Operating system: Ubuntu 18.04
  • PHP API Client

Expected behavior:

  • When we try to create ticket and something fails (missing data) it should just return the error and not create a empty ticket without any articles.

Actual behavior:

  • When the mime-type for a attachment is missing, zammad creates the ticket but no article and returns a error without a ticket id. So our API call doesn't know that the ticket has been created and retries it, which results in tons of empty tickets.

Steps to reproduce the behavior:

  • Create a ticket via the API with a attachment and leave the mime-type blank.

Yes I'm sure this is a bug and no feature request or a general question.

@martini
Copy link
Collaborator

martini commented Jan 3, 2019

@alex-LE please can you add your payload and the response from Zammad? Thanks!

@alex-LE
Copy link
Author

alex-LE commented Jan 3, 2019

@martini

Sure:

Payload: https://gist.github.com/alex-LE/7302e8ca581e66549ca27365fba1ebc7

Response: https://gist.github.com/alex-LE/e4370e160b1c705afc1c0d4aa07c413e
Status: 422 Unprocessable Entity

Tested with Postman (to avoid any API Client issues)

Ticket in Zammad:

grafik

@Jaykju
Copy link

Jaykju commented Jan 5, 2019

I have had this problem before as well. It always happened to me when any information sent in the article was invalid or missing. Not only the attachment mime-type but different fields as well.

@MrGeneration
Copy link
Member

I could verify this.
I simply removed "body" which is a essential article information needed for creating a ticket with article.

Zammad replies the following:

{
    "error": "Need at least article: { body: \"some text\" }"
}

But... the ticket gets created anyway, this really shouldn't happen!
image

My payload was:

{
    "group_id": 1,
    "priority_id": 3,
    "state_id": 2,
    "organization_id": 2,
    "title": "API-Test that works anyway",
    "owner_id": 3,
    "customer_id": 6,
    "note": null,
    "first_response_at": null,
    "first_response_escalation_at": "2019-01-31T10:50:28.000Z",
    "first_response_in_min": null,
    "first_response_diff_in_min": null,
    "close_at": null,
    "close_escalation_at": "2019-02-06T10:50:28.000Z",
    "close_in_min": null,
    "close_diff_in_min": null,
    "update_escalation_at": "2019-02-01T11:20:28.000Z",
    "update_in_min": null,
    "update_diff_in_min": null,
    "last_contact_at": "2019-01-14T15:50:28.000Z",
    "last_contact_agent_at": null,
    "last_contact_customer_at": "2019-01-14T15:50:28.000Z",
    "last_owner_update_at": null,
    "create_article_type_id": 5,
    "create_article_sender_id": 2,
    "article_count": 1,
    "escalation_at": "2019-01-31T10:50:28.000Z",
    "pending_time": null,
    "type": "email",
    "time_unit": null,
    "preferences": {
        "escalation_calculation": {
            "first_response_at": null,
            "last_update_at": "2019-01-14T15:50:28.000Z",
            "close_at": null,
            "sla_id": 1,
            "sla_updated_at": "2019-01-15T08:30:55.830Z",
            "calendar_id": 1,
            "calendar_updated_at": "2019-01-17T10:53:45.906Z",
            "escalation_disabled": false
        }
    },
    "updated_by_id": 3,
    "created_by_id": 3,
    "created_at": "2019-01-14T15:50:28.000Z",
    "updated_at": "2019-01-18T17:49:29.928Z",
	"tags": "gets,ignored,anyway",
	"article": {
        "type_id": 1,
        "sender_id": 2,
        "from": "LeTest <alias@secret.tld>",
        "to": "Users",
        "cc": null,
        "subject": null,
        "reply_to": null,
        "message_id": null,
        "message_id_md5": null,
        "in_reply_to": null,
        "content_type": "text/html",
        "references": null,
        "internal": false,
        "preferences": {},
        "updated_by_id": 3,
        "created_by_id": 3,
        "origin_by_id": 5,
        "created_at": "2019-01-14T15:51:50.000Z",
        "updated_at": "2019-01-14T15:51:50.341Z",
        "attachments": [],
        "type": "email",
        "sender": "Customer",
        "created_by": "alias@secret.tld",
        "updated_by": "alias@secret.tld",
        "origin_by": "test2@test.com"
    }
}

@thorsteneckel thorsteneckel added this to To do in OLD Workflow Sep 8, 2021
@mantas mantas self-assigned this Oct 4, 2021
@mantas mantas moved this from To do to Review in OLD Workflow Oct 11, 2021
@rolfschmidt rolfschmidt added this to the 5.1 milestone Nov 29, 2021
@mantas mantas moved this from Review to Done in OLD Workflow Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
OLD Workflow
  
Done
Development

No branches or pull requests

7 participants