/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


How to add a specific user to CC_List in a ticket?

04/22/2016 1600 views

How can I add a specific email address to the CC_LIST when a ticket is created?  I only know how to set that person to the CC_LIST which removes anyone else that was already in the list. 

Here is what my Update query looks like but this is just replacing the entire list.  I need to just add 'user@abc.com' to the existing list.

update HD_TICKET
    set HD_TICKET.CC_LIST = 'user@abc.com'
  where
        (HD_TICKET.ID in (<TICKET_IDS>))

Answer Summary:
2 Comments   [ + ] Show comments

Comments

  • totero21,

    Are you looking to have someone be added to the CC list of a ticket based upon the Category of ticket? If so that can be done in Queue Configuration.
  • No, it will be based on who the submitter is. This is for our HR portal and we have multiple locations. Depending on the submitter, we want our local IT people to be automatically CC'd in the tickets without the HR person having to add them each time.

Answer Chosen by the Author

1

Your UPDATE statement should look something like:

update HD_TICKET
set HD_TICKET.CC_LIST = CONCAT(HD_TICKET.CC_LIST,', user@abc.com')
where
(HD_TICKET.ID in (<TICKET_IDS>))

I can't recall off the top of my head what the CC_LIST field uses as a delimiter for multiple email addresses (space, comma, semicolon), but make sure to include that inside the quotes, too (I used comma in my example)

Answered 04/22/2016 by: BHC-Austin
4th Degree Black Belt

  • The delimiter is comma
  • Thanks, works great!
  • Thank you for this! I had the same issue with adding an email address to the existing CC list. Until now, I had to create separate rules and play with their priority but it was limited.
  • I have a follow-up question. It looks like the 'user@abc.com' is added every time the ticket is saved. This means the CC list is full of entries for the same email address if the ticket is saved multiple times. Is there a way to prevent that? Thank you
    • Try adding to the WHERE statement, something like "where (HD_TICKET.ID in (<TICKET_IDS>)) and (HD_TICKET.CC_LIST NOT LIKE '%user@abc.com%')"
      • Worked perfectly. I was worries that when CC is empty, and the address is added, it is added as
        ", user@abc.com"
        The comma goes away after the 2nd Save and it doesn't seem to impact the emails. Thanks again and stay safe.

Don't be a Stranger!

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

Sign up! or login

View more:

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