NinjaOne icon

NinjaOne

Consume NinjaOne API

Actions158

Ticketing → Create

AI-generated

Overview

This node allows creating a new ticket in a ticketing system via the NinjaOne API. It is designed to automate and streamline the process of submitting support or service tickets programmatically within an n8n workflow.

Common scenarios where this node is beneficial include:

  • Automatically generating tickets from monitoring alerts or system events.
  • Creating tickets based on customer requests collected through forms or other integrations.
  • Integrating ticket creation into broader IT service management workflows.

For example, when a CPU performance issue is detected by a monitoring tool, this node can create a ticket with relevant details such as client ID, subject, description, severity, and priority, ensuring timely tracking and resolution.

Properties

Name Meaning
Client Id Numeric identifier for the client (organization) associated with the ticket.
Ticket Form Id Numeric identifier specifying the form template used for the ticket.
Location Id Numeric identifier for the location related to the ticket.
Node Id Numeric identifier for the device associated with the ticket.
Subject Textual subject or title of the ticket describing the issue.
Description JSON object containing details about the ticket comment, including public visibility, body text, HTML formatted body, and time tracked in minutes. Example:
{
  "public": true,
  "body": "new comment",
  "htmlBody": "<p>new comment</p>",
  "timeTracked": 60
}
```                                                                                      |
| Status              | String representing the current status code of the ticket.                                     |
| Type                | Type of ticket; options are: PROBLEM, QUESTION, INCIDENT, TASK.                                |
| Cc                  | JSON object listing users and emails to be carbon copied on the ticket notifications. Example:  
```json
{
  "uids": [
    "1fa74a18-a329-40d8-b5b7-0a22624f7800",
    "b0558cb6-3c4e-438c-b8fd-5247c648bbbe"
  ],
  "emails": [
    "example1@example.com",
    "example2@example.com"
  ]
}
```                                                                                      |
| Assigned App User Id | Numeric identifier of the user assigned to handle the ticket.                                  |
| Requester Uid       | String unique identifier of the requester who created the ticket.                              |
| Severity            | Severity level of the ticket; options are: NONE, MINOR, MODERATE, MAJOR, CRITICAL.             |
| Priority            | Priority level of the ticket; options are: NONE, LOW, MEDIUM, HIGH.                            |
| Parent Ticket Id    | Numeric identifier of a parent ticket if this ticket is a sub-ticket or related to another.   |
| Tags                | JSON array of strings representing tags associated with the ticket. Example:  
```json
[
  "tag1",
  "tag2"
]
```                                                                                      |
| Attributes          | JSON array of attribute objects, each with `id` and `attributeId` fields, providing additional metadata. Example:  
```json
[
  {
    "id": 1,
    "attributeId": 1
  }
]
```                                                                                      |

## Output

The node outputs a JSON object representing the response from the NinjaOne API after creating the ticket. This typically includes details of the newly created ticket such as its unique identifier, status, and any other metadata returned by the API.

No binary data output is produced by this operation.

## Dependencies

- Requires an active connection to the NinjaOne API using OAuth2 authentication.
- The node depends on proper configuration of the NinjaOne OAuth2 API credentials within n8n.
- The API endpoint `/v2/tickets` (implied by the operation) must be accessible and the authenticated user must have permissions to create tickets.

## Troubleshooting

- **Missing Required Fields**: If required properties like Client Id, Ticket Form Id, Subject, or Status are not provided, the API will likely reject the request. Ensure all mandatory fields are set.
- **Invalid JSON Format**: Properties such as Description, Cc, Tags, and Attributes expect valid JSON strings. Malformed JSON will cause parsing errors.
- **Authentication Errors**: If the OAuth2 token is invalid or expired, the request will fail. Refresh or reconfigure the API credentials.
- **Permission Denied**: The authenticated user must have rights to create tickets; otherwise, the API will return authorization errors.
- **API Rate Limits**: Excessive requests may trigger rate limiting; implement error handling and retries accordingly.

Error messages from the API are passed through in the node's output when "Continue On Fail" is enabled, helping diagnose issues.

## Links and References

- [NinjaOne API Documentation](https://ncnod.com/c3sn8ka8) (general reference for endpoints and payloads)
- [n8n OAuth2 Credential Setup](https://ncnod.com/cqgzpgsn) (for configuring API authentication)
- [n8n Node Development Guide](https://ncnod.com/gzcngyr6) (for understanding node structure and properties)

Discussion