diff --git a/src/clients/core/ticketfields.js b/src/clients/core/ticketfields.js index ab9a3fe..bf04fd6 100644 --- a/src/clients/core/ticketfields.js +++ b/src/clients/core/ticketfields.js @@ -47,7 +47,7 @@ class TicketFields extends Client { /** * Lists all ticket fields. - * @returns {Promise>}>} Returns an array of ticket fields. + * @returns {Promise>}} Returns an array of ticket fields. * @async * @throws {Error} Throws an error if the request fails. * @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/#list-ticket-fields} @@ -59,6 +59,20 @@ class TicketFields extends Client { return this.getAll(['ticket_fields']); } + /** + * Lists all ticket fields with locale. + * @returns {Promise>}} Returns an array of ticket fields by locale. + * @async + * @throws {Error} Throws an error if the request fails. + * @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/#list-ticket-fields} + * @example + * const client = createClient({...}); + * const fields = await client.ticketfields.listWithLocale('sv'); + */ + async listWithLocale(locale) { + return this.getAll(['ticket_fields', { locale }]); + } + /** * Retrieves a specific ticket field by ID. * @param {number} ticketFieldId - The ID of the ticket field to retrieve.