Class TicketAgent
Proxy class for the Ticket Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class TicketAgent : ITicketAgent, IAgent
Constructors
TicketAgent(IAttachmentEntityImplementation, ITicketImplementation, ITicketEntityImplementation, ITicketMessageImplementation, ITicketMessageEntityImplementation, ITicketSummaryItemImplementation, ISoRequestItemsAccessor)
Proxy class for the Ticket Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public TicketAgent(IAttachmentEntityImplementation attachmentEntityImplementation, ITicketImplementation ticketImplementation, ITicketEntityImplementation ticketEntityImplementation, ITicketMessageImplementation ticketMessageImplementation, ITicketMessageEntityImplementation ticketMessageEntityImplementation, ITicketSummaryItemImplementation ticketSummaryItemImplementation, ISoRequestItemsAccessor accessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IAttachmentEntityImplementation | attachmentEntityImplementation | |
| ITicketImplementation | ticketImplementation | |
| ITicketEntityImplementation | ticketEntityImplementation | |
| ITicketMessageImplementation | ticketMessageImplementation | |
| ITicketMessageEntityImplementation | ticketMessageEntityImplementation | |
| ITicketSummaryItemImplementation | ticketSummaryItemImplementation | |
| ISoRequestItemsAccessor | accessor |
TicketAgent(IAttachmentEntityImplementation, ITicketImplementation, ITicketEntityImplementation, ITicketMessageImplementation, ITicketMessageEntityImplementation, ITicketSummaryItemImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)
Proxy class for the Ticket Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public TicketAgent(IAttachmentEntityImplementation attachmentEntityImplementation, ITicketImplementation ticketImplementation, ITicketEntityImplementation ticketEntityImplementation, ITicketMessageImplementation ticketMessageImplementation, ITicketMessageEntityImplementation ticketMessageEntityImplementation, ITicketSummaryItemImplementation ticketSummaryItemImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| IAttachmentEntityImplementation | attachmentEntityImplementation | |
| ITicketImplementation | ticketImplementation | |
| ITicketEntityImplementation | ticketEntityImplementation | |
| ITicketMessageImplementation | ticketMessageImplementation | |
| ITicketMessageEntityImplementation | ticketMessageEntityImplementation | |
| ITicketSummaryItemImplementation | ticketSummaryItemImplementation | |
| ISoRequestItemsAccessor | accessor | |
| IDebugUser | debugUser | |
| IServiceCallsRepository | serviceCallsRepository | |
| IScriptingConfiguration | scriptingConfiguration | |
| IOnlineConfiguration | onlineConfiguration |
Methods
AcceptTicketsAsync(int[], CancellationToken)
Accepts tickets by their ids. Sets owner to current user
Declaration
public Task AcceptTicketsAsync(int[] ticketIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ticketIds | Ids of tickets to be accepted. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
AddAttachmentsAsync(int, int[], CancellationToken)
Connect existing attachments with this TicketMessage. Can connect multiple attachments
Declaration
public Task AddAttachmentsAsync(int ticketMessageEntityId, int[] attachmentIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The id of the ticket message to connect the attachments to |
| int[] | attachmentIds | An array of attachments to connect to this TicketMessage |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
BatchForwardAsync(int[], string[], string[], string[], string, bool, CancellationToken)
Forwards selected tickets to specified recipients. This method starts a batch task.
Declaration
public Task<int> BatchForwardAsync(int[] ticketIds, string[] to, string[] cc, string[] bcc, string comment, bool closeTicket, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ticketIds | Ids of tickets to be forwarded. |
| string[] | to | The To-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>). |
| string[] | cc | The Cc-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>). |
| string[] | bcc | The Bcc-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>). |
| string | comment | Comment will be included before ticket messages. Might be empty |
| bool | closeTicket | If true, ticket will be closed after forwarding |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | ID of the new batch task. |
BatchReplyAsync(TicketBatchReplyData, CancellationToken)
Replies to the specified tickets. This method starts a batch task.
Declaration
public Task<int> BatchReplyAsync(TicketBatchReplyData batchReplyData, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketBatchReplyData | batchReplyData | All data needed to initiate a mass ticket reply sending. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | ID of the new batch task. |
CalculateMessageRecipientsAsync(int, MessageActionType, int, CancellationToken)
Gets recipients for new message
Declaration
public Task<Recipient[]> CalculateMessageRecipientsAsync(int ticketId, MessageActionType actionType, int messageId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The id of the ticket |
| MessageActionType | actionType | Message action |
| int | messageId | Optional ID of message being replied. Value <= 0 ignores parameter |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Recipient[]> | An array with Recipient objects |
ClearNotifyAsync(int[], CancellationToken)
Clear notification status for one or more tickets.
Declaration
public Task ClearNotifyAsync(int[] ids, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ids | List of notify IDs. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
CopyFromCRMDocumentAsync(int, CancellationToken)
Copy CRM document to an attachment
Declaration
public Task<AttachmentEntity> CopyFromCRMDocumentAsync(int documentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | documentId | The id of the document to copy to an attachment |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentEntity> |
CopyToTempFileAsync(string, int, CancellationToken)
Copy ticket attachment to temporary file. Needed for existing document dialog compatibility
Declaration
public Task<string> CopyToTempFileAsync(string filename, int attachmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | Preferred filename |
| int | attachmentId | The id of the attachment to copy |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | Temporary document filename |
CreateDefaultAttachmentEntityAsync(CancellationToken)
Loading default values into a new AttachmentEntity.
Declaration
public Task<AttachmentEntity> CreateDefaultAttachmentEntityAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentEntity> | New AttachmentEntity with default values |
CreateDefaultForTicketTypeAsync(int, CancellationToken)
Create default ticket entity for particular TicketType
Declaration
public Task<TicketEntity> CreateDefaultForTicketTypeAsync(int ticketTypeId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketTypeId | ID of ticket type |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | Default ticket entity |
CreateDefaultTicketEntityAsync(CancellationToken)
Loading default values into a new TicketEntity.
Declaration
public Task<TicketEntity> CreateDefaultTicketEntityAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | New TicketEntity with default values |
CreateDefaultTicketMessageEntityAsync(CancellationToken)
Loading default values into a new TicketMessageEntity.
Declaration
public Task<TicketMessageEntity> CreateDefaultTicketMessageEntityAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity> | New TicketMessageEntity with default values |
DeleteMessageHeadersAsync(int[], CancellationToken)
Removes headers from the message as specified in the collection of entity ids. The ids are message header ids (message header primary key)
Declaration
public Task DeleteMessageHeadersAsync(int[] headerIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | headerIds | Message header primary keys |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteTicketEntityAsync(int, CancellationToken)
Delete a ticket
Declaration
public Task DeleteTicketEntityAsync(int ticketEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketEntityId | The ticket to delete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteTicketMessageEntityAsync(int, CancellationToken)
Delete a ticket message
Declaration
public Task DeleteTicketMessageEntityAsync(int ticketMessageEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The ticket message to delete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DoEscalatingAsync(int, TicketPriorityEscalateAction, CancellationToken)
Checks if the ticket should change its alert level based on the priority and action. If it is to change, the alert level and alert timeout for the ticket will be updated.
Declaration
public Task DoEscalatingAsync(int ticketId, TicketPriorityEscalateAction action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The id of ticket |
| TicketPriorityEscalateAction | action | The action to use when calculating the escalation |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
GetAttachmentEntityAsync(int, CancellationToken)
Gets a AttachmentEntity object.
Declaration
public Task<AttachmentEntity> GetAttachmentEntityAsync(int attachmentEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | attachmentEntityId | The identifier of the AttachmentEntity object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentEntity> | A single AttachmentEntity |
GetAttachmentInfoAsync(int, CancellationToken)
Get a list with meta data for all attached attachments
Declaration
public Task<AttachmentEntity[]> GetAttachmentInfoAsync(int ticketMessageEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The id of the ticket message to get attachment infos for |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentEntity[]> | An array with AttachmentEntity objects, describing each attachment |
GetAttachmentInfoNonInlineAsync(int, CancellationToken)
Get a list with meta data for all attached attachments, EXCEPT those marked as inline
Declaration
public Task<AttachmentEntity[]> GetAttachmentInfoNonInlineAsync(int ticketMessageEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The id of the ticket message to get attachment infos for |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentEntity[]> | An array with AttachmentEntity objects, describing each attachment; those marked as INLINE will be skipped |
GetAttachmentPreviewAsync(int, CancellationToken)
Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
Declaration
public Task<AttachmentPreview> GetAttachmentPreviewAsync(int attachmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | attachmentId | The id of the attachment to retrieve |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentPreview> | Sanitized preview version of the attachment and additional metadata, if available |
GetAttachmentStreamAsync(int, CancellationToken)
Get the content of an attachment
Declaration
public Task<Stream> GetAttachmentStreamAsync(int attachmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | attachmentId | The id of the attachment to retrieve |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Stream> | A stream to the attachment content |
GetDefaultMessageContentAsync(int, MessageActionType, int, CancellationToken)
Obsolete, use GetDefaultMessageContentFull instead
Declaration
public Task<string> GetDefaultMessageContentAsync(int ticketId, MessageActionType messageActionType, int ticketMessageId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The id of the ticket |
| MessageActionType | messageActionType | Message action type: None/Reply/ReplyAll/Forward |
| int | ticketMessageId | The id of the message to quote in the returned content. 0 to skip/ignore |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | Sanitized HTML content |
GetDefaultMessageContentFullAsync(int, MessageActionType, int, int, CancellationToken)
Generate a default message content: attachments and body as sanitized HTML
Declaration
public Task<TicketMessageContent> GetDefaultMessageContentFullAsync(int ticketId, MessageActionType messageActionType, int ticketMessageId, int ticketTypeId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The id of the ticket |
| MessageActionType | messageActionType | Message action type: None/Reply/ReplyAll/Forward |
| int | ticketMessageId | The id of the message to quote in the returned content. 0 to skip/ignore |
| int | ticketTypeId | The id of the ticket type to look for reply template. 0 to use current ticket type |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageContent> | Generated default message content |
GetDefaultMessageContentWithOptionsAsync(int, MessageActionType, int, int, bool, CancellationToken)
Generate a default message content with option to exclude signature: attachments and body as sanitized HTML
Declaration
public Task<TicketMessageContent> GetDefaultMessageContentWithOptionsAsync(int ticketId, MessageActionType messageActionType, int ticketMessageId, int ticketTypeId, bool excludeSignature, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The id of the ticket |
| MessageActionType | messageActionType | Message action type: None/Reply/ReplyAll/Forward |
| int | ticketMessageId | The id of the message to quote in the returned content. 0 to skip/ignore |
| int | ticketTypeId | The id of the ticket type to look for reply template. 0 to use current ticket type |
| bool | excludeSignature | Flag to exclude a signature when generating the return content |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageContent> | Generated default message content |
GetForRmUiAsync(int, CancellationToken)
Get a ticket entity, adapted to the specific needs of the Request Management UI. WARNING: This endpoint is not guaranteed to be stable/compatible between versions
Declaration
public Task<TicketEntity> GetForRmUiAsync(int ticketId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | Primary key of ticket to fetch |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The ticket entity. Information is filtered/adapted to the current needs of the UI |
GetHotlistEjUsersAsync(int, int[], NotifyType, NotifyChannel, CancellationToken)
Get a list of ej_user ids who should receive hotlist notification based on request and notification type
Declaration
public Task<int[]> GetHotlistEjUsersAsync(int ticketId, int[] skipAssociateIds, NotifyType notifyType, NotifyChannel channel, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The id of the ticket |
| int[] | skipAssociateIds | A list of associate ids to skip when calculating whom to get the notification |
| NotifyType | notifyType | The notification type we want to check for |
| NotifyChannel | channel | The channel which we should check for |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int[]> | List of matching ej_user ids |
GetNextInQueueAsync(CancellationToken)
Assign a ticket to the caller based on intelligent queue system
Declaration
public Task<TicketEntity> GetNextInQueueAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The ticket entity after assigning it to the caller |
GetPreviewAttachmentStreamAsync(int, CancellationToken)
Deprecated, see GetPreviewAttachment instead. Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
Declaration
public Task<DocumentPreview> GetPreviewAttachmentStreamAsync(int attachmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | attachmentId | The id of the attachment to retrieve |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<DocumentPreview> | Sanitized preview version of the attachment |
GetRfcAttachmentStreamAsync(int, int, CancellationToken)
Get the content of an attachment which is part of RFC822 email attachment
Declaration
public Task<Stream> GetRfcAttachmentStreamAsync(int attachmentId, int position, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | attachmentId | The id of the root attachment |
| int | position | The position (index) of the attachment within the root attachment. Numbering starts from 0 |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Stream> | RFC822 attachment content as a Stream |
GetTicketAsync(int, CancellationToken)
Gets a Ticket object.
Declaration
public Task<Ticket> GetTicketAsync(int ticketId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The identifier of the Ticket object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Ticket> | A single Ticket |
GetTicketAttachmentsAsync(int, CancellationToken)
Get attachment infos for all attachments connected to messages in specified ticket
Declaration
public Task<AttachmentEntity[]> GetTicketAttachmentsAsync(int ticketEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketEntityId | The id of the ticket to get attachment infos from |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentEntity[]> | An array containing attachment info objects for all the attachments |
GetTicketEntityAsync(int, CancellationToken)
Gets a TicketEntity object.
Declaration
public Task<TicketEntity> GetTicketEntityAsync(int ticketEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketEntityId | The identifier of the TicketEntity object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | A single TicketEntity |
GetTicketMessageAsync(int, CancellationToken)
Gets a TicketMessage object.
Declaration
public Task<TicketMessage> GetTicketMessageAsync(int ticketMessageId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageId | The identifier of the TicketMessage object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessage> | A single TicketMessage |
GetTicketMessageEntitiesAsync(int, int[], CancellationToken)
Get ticket message entities with attachment info for given ticket
Declaration
public Task<TicketMessageEntity[]> GetTicketMessageEntitiesAsync(int ticketId, int[] messageIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | The id of the ticket to get message entities from |
| int[] | messageIds | Optional ids of message entities to get. If not provided, all ticket message entities will be returned. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity[]> | An array containing ticket message entities |
GetTicketMessageEntityAsync(int, CancellationToken)
Gets a TicketMessageEntity object.
Declaration
public Task<TicketMessageEntity> GetTicketMessageEntityAsync(int ticketMessageEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The identifier of the TicketMessageEntity object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity> | A single TicketMessageEntity |
GetTicketMessageWithEmbeddedDataAsync(int, ImageEmbedType, CancellationToken)
Get a ticket message entity with posibillity to change embedded images to be represented with inline data within the HTML body. If using inline data, be sure not to save this back to the database.
Declaration
public Task<TicketMessageEntity> GetTicketMessageWithEmbeddedDataAsync(int id, ImageEmbedType embedImages, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The id of the ticket message entity |
| ImageEmbedType | embedImages | If set to Inline, then use inline base64 data to represent the images in the HTML body. Default: Link will use link to the image. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity> | The entity to get |
GetTicketMessageWithOptionsAsync(int, bool, CancellationToken)
Get a ticket message entity with additional options.
Declaration
public Task<TicketMessageEntity> GetTicketMessageWithOptionsAsync(int ticketMessageEntityId, bool includeNonInlineAttachmentsInfo, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The id of the ticket message entity |
| bool | includeNonInlineAttachmentsInfo | If true, then non inline attachments info will be loaded into TicketMessageEntity |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity> | The entity to get |
GetTicketSummariesAsync(int[], CancellationToken)
Get an array of summaryitem for the given tickets
Declaration
public Task<TicketSummaryItem[]> GetTicketSummariesAsync(int[] ticketIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ticketIds | The tickets to fetch summaries for |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketSummaryItem[]> | Summary items for the given id's, in no particular order |
GetTicketsAsync(int[], CancellationToken)
Get multiple tickets
Declaration
public Task<Ticket[]> GetTicketsAsync(int[] ticketIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ticketIds | The ids of tickets to get |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<Ticket[]> | Returns array of tickets in same order as input ids |
Html2TextAsync(string, CancellationToken)
Create a plain text version of the html, suitable for email
Declaration
public Task<string> Html2TextAsync(string content, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | content | The html version |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | The plain text version |
MergeTicketsAsync(TicketEntity, int[], CancellationToken)
Merge one or more tickets into one primary ticket
Declaration
public Task<TicketEntity> MergeTicketsAsync(TicketEntity mergedTicketEntity, int[] secondaryTicketIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketEntity | mergedTicketEntity | Merged ticket entity |
| int[] | secondaryTicketIds | Ids of secondary tickets |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The newly merged entity |
NotifyNewTicketAsync(int, CancellationToken)
Notify user agents about the creation of a new ticket
Declaration
public Task NotifyNewTicketAsync(int ticketEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketEntityId | The id of the ticket to notify about |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
NotifyNewTicketMessageAsync(int, CancellationToken)
Notify user agents about the creation of a new message on a ticket
Declaration
public Task NotifyNewTicketMessageAsync(int ticketEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketEntityId | The id of the ticket to notify about |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
ProcessTicketWhenReadAsync(int, CancellationToken)
When a user view/read a ticket, a number of action should be performed: set read status, escalation handling, remove notifications, etc. Which actions will be performed depends on owner, caller and configuration
Declaration
public Task<TicketEntity> ProcessTicketWhenReadAsync(int ticketEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketEntityId | The id of the ticket to mark as read |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The ticket entity after marking it as read |
RemoveMessageAttachmentsAsync(int, int[], CancellationToken)
Removes attachments from the message as specified in the collection of entity ids. The ids are attachment ids (attachment primary key)
Declaration
public Task RemoveMessageAttachmentsAsync(int ticketMessageEntityId, int[] attachmentIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The id of the ticket message to remove attachments from |
| int[] | attachmentIds | Attachment primary keys |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
ResolveTicketIdAsync(int, CancellationToken)
Ticket can be connected (merged) to another ticket. This method traverses through its connection(s) and returns proper ticketId
Declaration
public Task<int> ResolveTicketIdAsync(int ticketId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketId | Potentially correct ticketId |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | Correct ticketId. Returns 0 in case ticket does not exists |
SanitizeMailContentAsync(string, CancellationToken)
Remove harmful HTML tags and attributes from an email
Declaration
public Task<string> SanitizeMailContentAsync(string content, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | content | The email content to sanitize |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | The sanitized email content |
SanitizeMailContentWithOptionsAsync(string, HtmlSanitizerOptions, CancellationToken)
Remove harmful HTML tags and attributes from an email, using specified options
Declaration
public Task<string> SanitizeMailContentWithOptionsAsync(string content, HtmlSanitizerOptions options, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | content | The email content to sanitize |
| HtmlSanitizerOptions | options | The options for the sanitizer engine |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string> | The sanitized email content |
SanitizeMailContentsAsync(string[], CancellationToken)
Remove harmful HTML tags and attributes from an email
Declaration
public Task<string[]> SanitizeMailContentsAsync(string[] contents, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | contents | The email contents to sanitize |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<string[]> | The sanitized email contents |
SaveAttachmentEntityAsync(AttachmentEntity, CancellationToken)
Updates the existing AttachmentEntity or creates a new AttachmentEntity if the id parameter is 0.
Declaration
public Task<AttachmentEntity> SaveAttachmentEntityAsync(AttachmentEntity attachmentEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AttachmentEntity | attachmentEntity | The AttachmentEntity that is saved |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentEntity> | New or updated AttachmentEntity |
SaveTicketEntityAsync(TicketEntity, CancellationToken)
Updates the existing TicketEntity or creates a new TicketEntity if the id parameter is 0. Does not notify users of save.
Declaration
public Task<TicketEntity> SaveTicketEntityAsync(TicketEntity ticketEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketEntity | ticketEntity | The TicketEntity that is saved |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | New or updated TicketEntity |
SaveTicketEntityWithNotifyAsync(TicketEntity, bool, CancellationToken)
Saves a ticket and performs any user notifications
Declaration
public Task<TicketEntity> SaveTicketEntityWithNotifyAsync(TicketEntity newEntity, bool notify, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketEntity | newEntity | The ticket to save |
| bool | notify | If true, then the notifications will be sent |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The newly saved entity |
SaveTicketMessageEntityAsync(TicketMessageEntity, CancellationToken)
Updates the existing TicketMessageEntity or creates a new TicketMessageEntity if the id parameter is 0. Does not notify users of save.
Declaration
public Task<TicketMessageEntity> SaveTicketMessageEntityAsync(TicketMessageEntity ticketMessageEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketMessageEntity | ticketMessageEntity | The TicketMessageEntity that is saved |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity> | New or updated TicketMessageEntity |
SaveTicketMessageEntityWithNotifyAsync(TicketMessageEntity, bool, CancellationToken)
Saves a ticket message and performs any user notifications
Declaration
public Task<TicketMessageEntity> SaveTicketMessageEntityWithNotifyAsync(TicketMessageEntity newEntity, bool notify, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketMessageEntity | newEntity | The ticket message to save |
| bool | notify | If true, then the notification will be sent along with the save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity> | The saved entity |
SaveTicketMessageEntityWithOptionsAsync(TicketMessageEntity, bool, int[], bool, CancellationToken)
Saves a ticket message and performs additional actions
Declaration
public Task<TicketMessageEntity> SaveTicketMessageEntityWithOptionsAsync(TicketMessageEntity entity, bool notify, int[] attachmentIds, bool updateRepliedAt, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketMessageEntity | entity | The ticket message to save |
| bool | notify | If true, then the notification will be sent along with the save |
| int[] | attachmentIds | An array of attachments to connect to this TicketMessage |
| bool | updateRepliedAt | Updates ticket's replied_at field if needed |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketMessageEntity> | The saved entity |
SendTicketMessageAsync(int, string[], string[], string[], string, int, string, CancellationToken)
Send a message to recipients by email
Declaration
public Task SendTicketMessageAsync(int ticketMessageEntityId, string[] to, string[] cc, string[] bcc, string subject, int replyTemplateId, string gdprSource, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The id of the ticket message to send |
| string[] | to | The To-recipients. Each recipient must be in correct format |
| string[] | cc | The Cc-recipients. Each recipient must be in correct format |
| string[] | bcc | The Bcc-recipients. Each recipient must be in correct format |
| string | subject | The subject |
| int | replyTemplateId | Optional ID of reply template to merge message with. <= 0 to skip. |
| string | gdprSource | Obsolete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
SendTicketMessageSmsAsync(int, int, string[], CancellationToken)
Send a message to recipients by sms
Declaration
public Task SendTicketMessageSmsAsync(int ticketMessageEntityId, int replyTemplateId, string[] sms, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageEntityId | The id of the ticket message to send |
| int | replyTemplateId | Optional ID of reply template to merge message with. <= 0 to skip. |
| string[] | sms | The Sms-recipients. Each recipient must be in correct format |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
SetDeletedStatusByIdsAsync(int[], CancellationToken)
Sets tickets' status to Deleted. After a grace period these tickets will be deleted by a background job.
Declaration
public Task<int[]> SetDeletedStatusByIdsAsync(int[] ticketIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ticketIds | Ids of tickets to be set for deletion. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int[]> | Ids of tickets set for deletion. |
SetDeletedStatusByProviderAsync(string, ArchiveRestrictionInfo[], CancellationToken)
Sets tickets' status to Deleted. After a grace period these tickets will be deleted by a background job.
Declaration
public Task<int[]> SetDeletedStatusByProviderAsync(string providerName, ArchiveRestrictionInfo[] restrictions, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | providerName | Name of the provider that returns ticket rows. |
| ArchiveRestrictionInfo[] | restrictions | Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int[]> | Ids of tickets set for deletion. |
SetTicketMessageImportantAsync(int, bool, CancellationToken)
Set the important flag on or off for a ticket message
Declaration
public Task SetTicketMessageImportantAsync(int ticketMessageId, bool important, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketMessageId | The id of the ticket message to set the important flag on |
| bool | important | Turn on or off the important flag |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
SetTicketReadByOwnerAsync(int, TicketReadStatus, bool, CancellationToken)
Set the ReadByOwner status for a ticket. It will only have an effect if the calling user is the same as the owner of the ticket
Declaration
public Task<TicketEntity> SetTicketReadByOwnerAsync(int ticketEntityId, TicketReadStatus readStatus, bool checkEscalating, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ticketEntityId | The id of the ticket to set |
| TicketReadStatus | readStatus | The read status to set. See the enum for explanation of the different colors. Setting Unknown does nothing |
| bool | checkEscalating | If true, then the escalation system will be called and executed when setting the ReadByOwner |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The ticket entity after setting the ReadByOwner |
SplitTicketAsync(int, int, DateTime, int[], TicketEntity, CancellationToken)
Save new ticket and move/copy data from existing ticket in a single request. Specified messages will be moved.
Declaration
public Task<TicketEntity> SplitTicketAsync(int sourceTicketEntityId, int sourceTicketEntityStatusId, DateTime sourceTicketEntityActivate, int[] transferMessageIds, TicketEntity newTicketEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | sourceTicketEntityId | The id of the ticket to split |
| int | sourceTicketEntityStatusId | The id of the source ticket's status |
| DateTime | sourceTicketEntityActivate | The activate date of the source ticket |
| int[] | transferMessageIds | IDs of messages that should be transferred from the original ticket to the new one |
| TicketEntity | newTicketEntity | The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The newly created entity |
SplitTicketMessageAsync(TicketMessageEntity, TicketEntity, TicketMessageEntity, int[], CancellationToken)
Create new ticket and move/copy data from existing ticket in addition update old message and save new message in a single request.
Declaration
public Task<TicketEntity> SplitTicketMessageAsync(TicketMessageEntity sourceTicketMessage, TicketEntity newTicketEntity, TicketMessageEntity newTicketMessage, int[] transferAttachmentsIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TicketMessageEntity | sourceTicketMessage | The message being splitted, content can be modified as part of the split. |
| TicketEntity | newTicketEntity | The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages. |
| TicketMessageEntity | newTicketMessage | The new message to be saved |
| int[] | transferAttachmentsIds | IDs of attachments that should be transferred from the original message to the new one |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TicketEntity> | The newly created entity |
UndeleteByIdsAsync(int[], CancellationToken)
Restores deleted tickets by their ids. Status is set to a default open status defined in Registry table
Declaration
public Task UndeleteByIdsAsync(int[] ticketIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ticketIds | Ids of tickets to be restored. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
UpdateTicketsReadStatusAsync(int[], TicketReadStatus, CancellationToken)
This method changes multiple tickets' read status
Declaration
public Task<int[]> UpdateTicketsReadStatusAsync(int[] ticketIds, TicketReadStatus newStatus, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ticketIds | Ticket ids to be updated |
| TicketReadStatus | newStatus | New read status |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int[]> | Updated ticket ids |
UpdateTicketsReadStatusByProviderAsync(string, ArchiveRestrictionInfo[], TicketReadStatus, CancellationToken)
This method changes multiple tickets' read status
Declaration
public Task<int[]> UpdateTicketsReadStatusByProviderAsync(string provider, ArchiveRestrictionInfo[] restrictions, TicketReadStatus newStatus, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | provider | Name of the provider that returns ticket rows. |
| ArchiveRestrictionInfo[] | restrictions | Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. |
| TicketReadStatus | newStatus | New read status |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int[]> | Updated ticket ids |
UploadAttachmentAsync(int, Stream, CancellationToken)
Upload the content for an attachment
Declaration
public Task UploadAttachmentAsync(int attachmentId, Stream content, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | attachmentId | The id of the attachment row, for which to attach the upload data |
| Stream | content | A stream to the content to be uploaded |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
ValidateAttachmentsAsync(int[], CancellationToken)
Check attachments, return validation result for each item
Declaration
public Task<AttachmentValidationResult[]> ValidateAttachmentsAsync(int[] attachmentIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | attachmentIds | The IDs of the attachments to validate |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AttachmentValidationResult[]> | Validation result |