/bundles/itninjaweb/img/Breadcrumb_cap_w.png
I tried copy/pasting what was suggested in this question: http://www.itninja.com/question/create-a-rule-to-assign-the-first-service-desk-commenter-as-the-owner-and-change-status  but it's not working. If I comment and hit Submit, nothing. If I comment and hit Save, nothing. 

Is something wrong, or need to be edited, in the SQL section? I am using the latest version 8.0.318. 

Select SQL:
SELECT		HD_TICKET.ID,
HD_TICKET.TITLE,
HD_TICKET.SUMMARY,
HD_TICKET.OWNER_ID,
HD_TICKET.SUBMITTER_ID,
HD_TICKET.HD_STATUS_ID,
C.USER_ID,
C.COMMENT
FROM ORG1.HD_TICKET
JOIN ORG1.HD_TICKET_CHANGE C on C.HD_TICKET_ID = HD_TICKET.ID
WHERE C.COMMENT != '' AND
SUBMITTER_ID != USER_ID AND
HD_TICKET.OWNER_ID = 0
  Run update query:
UPDATE    HD_TICKET
JOIN      HD_TICKET_CHANGE C on C.HD_TICKET_ID = HD_TICKET.ID
SET      HD_TICKET.OWNER_ID = C.USER_ID
WHERE     C.COMMENT != '' AND
SUBMITTER_ID != USER_ID AND
HD_TICKET.OWNER_ID = 0        AND
         HD_TICKET.ID in (<TICKET_IDS>)
frequency:
when saving ticket
Answer Summary:
Cancel
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Answer Chosen by the Author


Answers

1
I'm no SQL guru, but looking at the code in "english" the update statement seems to say

Update the ticket owner ID to the user ID 
when the comment is not a space and
when the submitter is not the user and
when there is no ticket owner

maybe try it without the line 
HD_TICKET.OWNER_ID = 0

Answered 02/05/2018 by: Hobbsy
Red Belt

  • Thanks! I removed HD_TICKET.OWNER_ID = 0 AND from the Update SQL section and that worked. Our emails say "ticket assigned to: ()" inow nstead of the owner's name but that's a problem for another time.
Please log in to comment
Answer this question or Comment on this question for clarity

Answers

Share