REST API Create ticket

POST /helpdesk/create_ticket.xml

Creates new Helpdesk ticket with related contact

Parameters

Parameter Type Description
ticket[issue][project_id] integer Create ticket in project with id
ticket[issue][tracker_id] string New ticket tracker
ticket[issue][description] string New ticket content
... any other fields from Issues REST API
ticket[contact][first_name] string new customer first name
ticket[contact][last_name] string new customer last name
ticket[contact][middle_name] string new customer middle name
ticket[contact][tag_list] string new customer tags
ticket[contact][company] string new customer company
ticket[contact][email] string new customer email
... any other fields from Contacts REST API

Examples

POST /helpdesk/create_ticket.xml
<?xml version="1.0"?>
<ticket>
  <issue>
    <project_id>support</project_id>
    <tracker_id>1</tracker_id>
    <subject>New ticket subject</subject>
    <description>New ticket description</description>
    <assigned_to_id>1</assigned_to_id>
  </issue>
  <contact>
    <email>test@example.com</email>
    <first_name>John</first_name>
    <custom_fields type="array">
       <custom_field id="1">
         <value>Test</value>
       </custom_field>
    </custom_fields>
  </contact>
</ticket>

cURL example:

curl -i -H 'Content-Type: application/xml' -X POST --data '<ticket><issue><project_id>helpdesk</project_id><tracker_id>6</tracker_id><subject>New ticket from API</subject><description>Description for ticket created using REST API</description><assigned_to_id>4</assigned_to_id></issue><contact><email>test@example.com</email><first_name>John</first_name><custom_fields type="array"><custom_field id="1"><value>Test</value></custom_field></custom_fields></contact></ticket>' -u admin:admin http://demo.redminecrm.com/helpdesk/create_ticket.xml
</first_name></contact></ticket>" -u admin:admin http://demo.redminecrm.com/helpdesk/create_ticket.xml 

Existed contact will be founded by email address

Create a ticket without sending an auto answer email

POST /helpdesk_tickets.json?key=<your_api_key>
    {
      "helpdesk_ticket": {
        "issue": {
          "project_id": "1",
          "subject": "test api helpdesk 2",
          "description": "ticket description" 
        },
        "contact": {
          "email": "test@api.com",
          "first_name": "Smith" 
        }
      }
    }

Create a ticket with sending an auto answer email

POST /helpdesk_tickets.json?key=<your_api_key>
    {
      "helpdesk_ticket": {
        "issue": {
          "project_id": "1",
          "subject": "test api helpdesk 2",
          "description": "ticket description" 
        },
        "contact": {
          "email": "test@api.com",
          "first_name": "Smith" 
        },
        "send_as": "auto_answer" 
      }
    }
Was this article helpful? Yes  No
239 from 267 found this helpful