I have all the information that I need to copy from the parent to the child ticket but can't seem to get the comments not made by the system to copy to the child tickets. Has anyone else had any luck with that?  I only want the non system generated comments to copy. 

Thanks 

2 Comments   [ + ] Show Comments

Comments

  • Figured out what the problem was I was using an old ticket but once I created a new one it worked but I want to add comments to copy across anyone figured this out yet?
  • This copies the summary in the ticket not the actual comments which is what I am looking for.
Please log in to comment

Answers

1
Below is an example of how we have achieved this functionality

Select Statement
SELECT
HD_TICKET.ID,
HD_TICKET.CUSTOM_FIELD_VALUE0,
HD_TICKET.CUSTOM_FIELD_VALUE5,
        HD_TICKET.SUMMARY,
        HD_TICKET.DUE_DATE,
HD_TICKET.PARENT_ID,
PARENT_TICKET.ID AS P_ID,
        PARENT_TICKET.DUE_DATE AS P_DUE_DATE,
PARENT_TICKET.CUSTOM_FIELD_VALUE0 AS P_CUSTOM_FIELD_VALUE0,
PARENT_TICKET.CUSTOM_FIELD_VALUE5 AS P_CUSTOM_FIELD_VALUE5,
PARENT_TICKET.IS_PARENT

FROM
HD_TICKET
LEFT JOIN HD_TICKET PARENT_TICKET ON HD_TICKET.PARENT_ID = PARENT_TICKET.ID
WHERE
HD_TICKET.PARENT_ID != "" AND HD_TICKET.HD_QUEUE_ID = 1

Update Statement

UPDATE
HD_TICKET
LEFT JOIN HD_TICKET PARENT_TICKET ON HD_TICKET.PARENT_ID = PARENT_TICKET.ID

SET
HD_TICKET.CUSTOM_FIELD_VALUE0 = PARENT_TICKET.CUSTOM_FIELD_VALUE0,
        HD_TICKET.DUE_DATE = PARENT_TICKET.DUE_DATE,
HD_TICKET.CUSTOM_FIELD_VALUE5 = PARENT_TICKET.CUSTOM_FIELD_VALUE5
WHERE
HD_TICKET.ID in (<TICKET_IDS>)

Note that in the select statement it selects data for both the parent and child tickets and then in the update statement copies across the data.

To try this out I suggest you simplify to a single data value and then build up your query from there
Answered 01/26/2016 by: Hobbsy
Red Belt

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

Share