populating the subject on email client template using scripting

shreekanth b na
Tera Contributor

Hi All,
We have a requirement to add the case number in the subject field at the beginning of the email client template once agent clicks reply button, but if agent tries to reply back on the received email which already has case number in the subject, in this scenario the email subject will have repetitive case number.
 
eg,
    • if requester sends the email to create case via email with subject Create Case a new case will be created.
    • If agent reply back on top of this received email, by default we are prefixing the case number lets say CASE1234 with subject sent by requestor i,e Create Case, now the subject will be CASE1234: Create Case
    • suppose requester replies back on the received email with subject CASE1234: Create Case
    • And now if the agent tries to reply back on the received email, the subject will be like CASE1234: CASE1234: Create Case.


So basically when every time agent click on the reply button we are adding the case number and received email subject in the current reply email looks somewhat like this CASE1234: CASE1234: Create Case, and for next reply from agent the subject will be CASE1234: CASE1234: CASE1234: Create Case.
 
we tried to rectify this observation by calling script include in the subject field and also tried by setting the subject using mail script in both case we are not able to populate the required subject. i,e CASE1234: Create Case.
 
Kindly let us know, if you came across this scenario and what was the walkaround solution that you opted.
 
Thanks
Shreekanth

2 REPLIES 2

pardhiv
Tera Contributor

I have a similar requirement , Were you able to populate subject using Mail Script.

If yes , Can you please share the Sample Script?

Here is mine.

https://www.servicenow.com/community/developer-forum/mail-script-for-subject-using-email-client-temp...

Pooja Mahajan
Tera Contributor

Hi, Did you get solution over this?