/build/static/layout/Breadcrumb_cap_w.png

Miscellaneous Question


Service Desk - Copy comment from parent ticket to children, and preserve the Owners Only Flag?

12/16/2014 1059 views
Hi all,

I'm having trouble building a rule that processes on save and takes comments from a parent ticket and adds them to the children, while preserving the Owners Only flag.  Does anyone out there do this today?
0 Comments   [ + ] Show comments

Comments


All Answers

0
This is the query that I use for that....

-- SELECT SQL:

SELECT PARENT.TITLE, 
HD_TICKET.TITLE, 
HD_TICKET.ID, 
PARENT.CUSTOM_FIELD_VALUE1,
PARENT.CUSTOM_FIELD_VALUE2,
PARENT.CUSTOM_FIELD_VALUE3,
PARENT.CUSTOM_FIELD_VALUE4,
PARENT.CUSTOM_FIELD_VALUE5,
PARENT.CUSTOM_FIELD_VALUE6,
PARENT.CUSTOM_FIELD_VALUE7,
PARENT.CUSTOM_FIELD_VALUE8,
C.COMMENT
FROM HD_TICKET PARENT, HD_TICKET, HD_TICKET_CHANGE C
WHERE PARENT.ID = HD_TICKET.PARENT_ID
and PARENT.HD_QUEUE_ID = 9 -- change to desired queue
and C.HD_TICKET_ID = HD_TICKET.ID
AND HD_TICKET.CREATED > DATE_SUB(NOW(), INTERVAL 10 SECOND)


-- UPDATE SQL:

UPDATE HD_TICKET PARENT,HD_TICKET_CHANGE C, HD_TICKET
SET HD_TICKET.TITLE = PARENT.TITLE,
C.COMMENT = concat(
'Office: ',
PARENT.CUSTOM_FIELD_VALUE1,
'    Company: ',
PARENT.CUSTOM_FIELD_VALUE2,
'    EmployeeID: ',
PARENT.CUSTOM_FIELD_VALUE3,
'    Start Date: ',
PARENT.CUSTOM_FIELD_VALUE4,
'    GP Account: ',
PARENT.CUSTOM_FIELD_VALUE5,
'    Time Entry Account: ',
PARENT.CUSTOM_FIELD_VALUE6,
'    Pivots Account: ',
PARENT.CUSTOM_FIELD_VALUE7,
'    Bid Log Account: ',
PARENT.CUSTOM_FIELD_VALUE8
)
C.OWNERS_ONLY = 1
WHERE PARENT.ID = HD_TICKET.PARENT_ID
and C.HD_TICKET_ID = HD_TICKET.ID
and HD_TICKET.HD_QUEUE_ID = 4 -- change to desired queue
AND HD_TICKET.ID IN (<TICKET_IDS>)


Answered 12/17/2014 by: h2opolo25
Red Belt

  • Does this make every comment on the child an Owners Only comment, or just the stuff that is already Owners Only?
    • The rule transfers one comment over when the ticket is created. If you were to remove the last line on the select statement it would append the custom field info to every comment and also make all comments owners only.

      This rule is meant as a template. You need to customize it to your environment.
  • what about copying all the comments from a parent ticket to the child ticket instead of Custom fields?

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ