Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Change subject on ticket, reflected in reply template?

I got a customer who would like to change the subject on request coming from a certain sender and have this reflected in the subject line on the reply sent back. For testing, I put together a simple script and attached it a an email filter. Changing the subject on the request works fine, but I cannot get the subject on the reply to reflect this change..

Is this even achievalbe?

RE: Change subject on ticket, reflected in reply template?


What is probably happening is that change of subject is executed after reply template is sent. One way of accomplishing this would be to edit your email filter to "block auto reply" and instead send from your script. 


Ticket t;
  t.setValue("title", "My new Ticket title");;

  //Send Auto Reply - first get id of reply template
  String filterId = t.getValue("filter_id");
  String rtId;
  SearchEngine se;
  se.addCriteria("", "equals", filterId);
  if( > 0)
    rtId = se.getField(0);
  if(rtId != "")
    ReplyTemplate rt;
    Parser p;
    Email email;
    email.setValue("from", t.getMailFrom());
    email.setValue("subject", p.parseString(rt.getSubject(0)));
    email.setValue("bodyHtml", p.parseString(rt.getHtmlBody(0)));
    email.setValue("to", getVariable("customerEmail"));
Von: Michel Krohn-Dale 29. Sep 2020

RE: Change subject on ticket, reflected in reply template?

Perfect, thanks!

Von: Patrik Larsson 29. Sep 2020