Skip to main content

ITicketAutoAction

By implementing the ITicketAutoAction interface in a application script, you can define custom actions based on a change in the value of a ticket field or respond to a newly created ticket. In the newly created script, set the value of the Name property (the name of the automatic action) in the action class constructor.

tip

To store properties and action settings, we recommend defining the Settings class in a separate script that you create from the Class Library template.

warning

If you want to use only some of the methods of the implemented interface in the automatic action, leave an exception in the body of the other methods from the interface:

throw new NotImplementedException();

Interface methods

MethodDescription
OnTicketChangedChange the ticket field.
OnTicketCreatedCreate a ticket.

OnTicketChanged

Custom action based on a change in the value of a ticket field (custom/system). In the implemented method, define both the conditions for performing the operations and the operations themselves.

  • Syntax: void OnTicketChanged(SqlConnection con, SqlTransaction trans, int ticketId, int personId, stringproperties)
  • Parameters:
    • con - SqlConnection to the database.
    • trans - SqlTransaction of the database transaction in progress.
    • ticketId - The ID of the ticket (tHdTicket.iHdTicketId) to which the custom action applies.
    • personId - The ID of the user (tPerson.iPersonId) who executed the event on the ticket. In some cases it could be the system, then the value is NULL.
    • properties - the changed ticket fields separated by a comma ( table.column).
table.columnTicket field
tHdTicket.TicketStateIdStatus
tHdTicket.liHdTicketSlaIdSLA
tHdTicket.dHdTicketDeadlineDeadline
tHdTicket.liHdTicketHdSectionIdService
tHdTicket.iHdTicketUserRequester
tHdTicket.liHdTicketSolverPersonIdSolver
tHdTicket.SolverGroupRoleIdSolver group
tHdTicket.sHdTicketTicket name
tHdTicket.liHdTicketPriorityIdPriority
tHdTicket.ImpactImpact
tHdTicket.UrgencyUrgency
tHdTicket.mHdTicketNoticeNotes
tHdTicket.sHdTicketGroupGroup
tHdTicket.sHdTicketDeviceCodeDevice number
tHdTicket.FeedbackSolveSpeedSolve speed
tHdTicket.FeedbackProfessionalityProfessionality
tHdTicket.FeedbackExpertiseExpertise
tHdTicket.FeedbackCommentComments and Notes
tHdTicket.RelatedAccountIdRelated organization
tHdTicket.ObjectsObjects
tHdTicket.RequestedForPersonIdRequested for
tHdTicket.InternalTargetInternal target
tHdTicket.InternalTargetDeadlineInternal target deadline
tHdTicketCust.*Custom fields
  • Return value: none.

For an example use case, see the AssignToTester application template.

OnTicketCreated

Custom action based on the creation of a ticket. In the implemented method, define both the conditions for executing the operations and the operations with the ticket itself.

  • Syntax: void OnTicketCreated(SqlConnection con, SqlTransaction trans, int ticketId, int personId)
  • Parameters:
    • con - SqlConnection to the database.
    • trans - SqlTransaction of the ongoing database transaction.
    • ticketId - New ticket ID (tHdTicket.iHdTicketId).
    • personId - ID of the user (tPerson.iPersonId) who created the ticket (does not always have to be the requester).
  • Return value: none.

For an example use case, see the CreateAnalysis application template.