Script for copy mail field to cc_list
Hello,
i have a question about tickets on K1000. I want to know if someone has a script which copy the adresse field into the cc_list field ? For not having to copy and paste by hand each time ...
Thank you
i have a question about tickets on K1000. I want to know if someone has a script which copy the adresse field into the cc_list field ? For not having to copy and paste by hand each time ...
Thank you
2 Comments
[ + ] Show comments
-
Which address field? The submitter's? - chucksteel 8 years ago
-
yeah the mail address of the submitter. I would like to automaticaly copy this address into the cc_list field ... - Crash73 8 years ago
-
If there is something already in the cc_list field do you care if it is overwritten? - chucksteel 8 years ago
-
No, there is nothing in the cc_list field - Crash73 8 years ago
Answers (1)
Please log in to answer
Posted by:
chucksteel
8 years ago
This select statement will match tickets without a value in the CC_LIST field. I did it this way because otherwise the rule would run on every ticket save and that's not as efficient. Of course if you want the CC_LIST field to change if the submitter changes then you would need to change this.
select HD_TICKET.* from HD_TICKET
where HD_TICKET.CC_LIST =''
This update statement will set the CC_LIST field to the email address of the submitter:
update HD_TICKET
set HD_TICKET.CC_LIST =
(select USER.EMAIL from USER where USER.ID = HD_TICKET.SUBMITTER)
where
(HD_TICKET.ID in (<TICKET_IDS>))
Comments:
-
Fine, i will try it. thanks u ! - Crash73 8 years ago