Update ticket and open 'Email Client Template' in a single UI Action

Jason Nicholas
Tera Expert

Hi

 

I am trying to create a UI action that does 2 things

  1. Pop up a Client email
  2. Update a field on the ticket with date & Time

I seem to be able to do both seperatly but not togeother,. hers is my code

 

To update the incident:

gs.eventQueue('leaver.email', current);
current.u_email_sent_to_sme = gs.nowDateTime();
action.setRedirectURL(current);
current.update();

 

To call the Email Client Template:

function showEmail1(){
emailClientOpenPop('request', false, null, null, '1537a78e1b4fb550cbb7dce7b04bcb06');
}

 

Obviously to call the template I need to select Client on the UI Action & add the function to 'Onclick' however when I do this the part that updates the ticket does not work. If I add the ticket update to the function or a separate function this does not work. Both coded separately work OK.

2 ACCEPTED SOLUTIONS

Hi,

Please update your script like below:

function showEmail1() {
    emailClientOpenPop('request', false, null, null, '1537a78e1b4fb550cbb7dce7b04bcb06');
    gsftSubmit(null, g_form.getFormElement(), "update_request");
}
if (typeof window == 'undefined')
    serverCall();

function serverCall() {
    gs.eventQueue('leaver.email', current);
    current.u_email_sent_to_sme = gs.nowDateTime();
    current.update();
    action.setRedirectURL(current);   
}

 

View solution in original post

10 REPLIES 10

Ankur

 

Please see my response to Anil, I had it fixed in Dev but does not work in Prod

 

Jason