I would like to write a ticket rule that changes the value of a custom field, based on which process the ticket belongs to.  This is necessary because whenever a regular ticket is converted into a process ticket, fields in the original/parent ticket are not changed to the defaults defined in the process.
Answer Summary:
Cancel
2 Comments   [ + ] Show Comments

Comments

  • Thank you. So, what statements would I need to include in the Select and Update code to search for a parent ticket (HD_TICKET.PARENT_ID <> 0 and HD_TICKET.CUSTOM_FIELD_VALUE21 = 'N/A', which is a default field value) and then display the Process/Service Name in HD_TICKET.CUSTOM_FIELD_VALUE21?

    Hopefully this is not extremely complicated...
  • Actually, probably should have said: HD_TICKET.PARENT_ID = 0
Please log in to comment

Answer Chosen by the Author

1
This will return the ticket IDs for tickets that:
Are in a process
Are a parent (or more technically don't have a parent)
Have a custom field 22 (CUSTOM_FIELD_VALUE21 in the table) value equal to N/A
SELECT HD_TICKET.ID FROM HD_TICKET
JOIN HD_SERVICE_TICKET on HD_SERVICE_TICKET.ID = HD_TICKET.SERVICE_TICKET_ID
JOIN HD_SERVICE on HD_SERVICE.ID = HD_SERVICE_TICKET.HD_SERVICE_ID
WHERE HD_TICKET.SERVICE_TICKET_ID != 0
and HD_TICKET.PARENT_ID = 0
and HD_TICKET.CUSTOM_FIELD_VALUE21 = 'N/A'

Answered 08/26/2016 by: chucksteel
Red Belt

Please log in to comment

Answers

2
Here is the route from a ticket ID to a process ID (processes are termed service in the tables, I have no idea why):
HD_TICKET.SERVICE_TICKET_ID = HD_SERVICE_TICKET.ID
HD_SERVICE_TICKET.HD_SERVICE_ID = HD_SERVICE.ID



Answered 08/25/2016 by: chucksteel
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share