Clarity Service Management

Expand all | Collapse all

Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

Jump to Best Answer
  • 1.  Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 11-16-2015 03:38 PM

    I need to customize the resolution notification message with the “like” and “unlike” buttons of Facebook.

     

    The case is:

     

    • When the client, on the body of the e-mail message clicks on the “like” button, his ticket automatic (and magically) change the status to “Closed” without having to access the application.

     

    • When clicks on the “Unlike” button, a page on SDM wiil be open (request_status_change.htmpl) and he write what's wrong with the ticket and will reopen it.

     

    Ok, the last case i did with some html changes and is working perfectly, the users clicks on the “Unlike” button and are redirected to the page to reopen the ticket.

     

    I am having great difficulty thinking in a way to make even in the html message, the user clicks on the image "Like" and (magically) the status of the ticket in question is changed to "closed" .

     

    The major problem is to find some way to change the ticket status without the user having to access the application.

     

    Could anyone help?

     

    Here are some information regarding the changes!!

     

    The message:

     

    message.jpg

    The code:

     

    <!-- START LIKE -->

    <p><a href="@{call_req_id.web_url}+HTMPL=request_status_change_MJ.htmpl+INSTANCE=@{id}"><img align="left" width="90" length="90" src="image_url"></a>

    <!-- END LIKE -->

    <!-- START UNLIKE -->

    <a href="SOME CODE OR SCRIPT TO CLOSE TICKET" onclick="if (! confirm('Messa to...?')) { return false; }"><img align="right" width="90" length="90" src="image_url"

    ></a>

    <!-- END UNLIKE -->



  • 2.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 11-16-2015 05:58 PM

    Hi, we have client that uses similar functionality. We have created links in email that opens new email message that allready contains predefined keywords that are needed to update status for the ticket. 



  • 3.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 11-17-2015 07:46 AM

    Hi, Gutis

     

    Thank you for the quick response!!!!!

     

    Could you give me details of this setting?

     

    I'm thinking in something like API...

     

    Thanx again, Gutis!!!



  • 4.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O
    Best Answer

    Posted 11-17-2015 09:13 AM

    We have email rule for update that checks if subject contains particular phrase. So if %REQUEST_ID keyword is found it updates matching ticket. You can use %STATUS to set any status you wan't



  • 5.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 11-17-2015 08:57 AM

    Hi, my actual customer created a aspx webpage that is being opened with image url in Email. He manage the survey with this webPage, he save customer feedback, and update ticket accordingly via webService.



  • 6.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 12-17-2015 09:44 AM

    Guys, im still in trouble!! =(

    To make this customization possible i created a Windows PoweShell code to send an e-mail to maileater with %STATUS=CLOSED with a single click, code bellow:

    ######### Inicio do Script #########
    #### Configurando Servidor Smtp #################
    $servidor = "smtpsrv.mj.gov.br";
    $porta_smtp="25";
    $porta_smtp_ssl="587";
    
    
    #### Configurando Conta Smtp ####################
    $conta = "sati@mj.gov.br";
    $senha = "123456";
    
    
    #### Configurando Assunto e corpo da mensagem##########
    $assunto = "@{call_req_id.web_url}+INSTANCE=@{id}";
    $assunto = System.Text.UTF8Encoding($assunto);
    $corpo = "%%STATUS=Fechada";
    
    
    #### Configurando E-mail do Destinatario das Mensagens ########
    $destinatario = "Diego.Gomes@consorciomais2web.com.br";
    
    
    #### Configurando Diretório para execução do envio de e-mail ######
    $SMTPSend="C:\Users\servicedesk\Documents\sendmail";
    Set-Location $SMTPSend;
    
    
    #### Exportando o comando para execução em arquivo batch com suporte a smtp comum ##########
    envia_email="cmd.exe /C smtpsend.exe -f$conta -t$destinatario -s$assunto -mbt$corpo -a$anexo -h$servidor -p$porta_smtp -lu$conta -lp$senha";
    echo $envia_email | Out-File -FilePath envia-email.bat -Encoding ASCII;
    #### Executa envio de e-mail #####
    .\envia-email.bat;
    
    
    #### Exportando o comando para execução em arquivo batch com suporte a smtp com ssl ##########
    $envia_email_ssl="cmd.exe /C smtpsend.exe -f$conta -t$destinatario -s$assunto -mbt$corpo -a$anexo -h$servidor -p$porta_smtp_ssl -lu$conta -lp$senha";
    echo $envia_email_ssl | Out-File -FilePath envia-email-ssl.bat -Encoding ASCII;
    #### Executa envio de e-mail com suporte ssl #####
    .\envia-email-ssl.bat;
    
    
    #### Remove arquivo .bat depois da execução por segurança #########
    del -rec envia-email.bat;
    del -rec envia-email-ssl.bat;
    
    
    # OBS: Descomente a seção de Exportação do arquivo bat no qual irá utilizar para enviar o seu e-mail, se for utilizar smtp comum ou smtp com ssl.
    ######### Fim do Script #########
    

     

    Ok, the e-mail is being sent with the arguments that i need.

    The problem is, how can i put this .ps1 file on a image in notification message?

    I put this file in HTML notification message, as shown below:

     

    <p><img align="left" width="90" length="90" src="like_image_url" onclick="window.open('file:sendmail.ps1')">
    

     

    I´m no able to know if this customization is the best and secure way to finally resolve this issue!

    I understand that is no easy to run a script on a computer with a single click, in my tests to run a script with a single click a lot of configurations and security exceptions were made in my computer to allow the execution of this functionality, and i really dont know if this is the better way to make the customer close your ticket without leaving your e-mail message.

    I dont know if the notification message is being sent when a put the code bellow into "like" image, the message is not being sent! =/

    Can help me with some ideas to make this happen?

    My customer is about to drive me crazy!!!!

    Many thanx again!!!



  • 7.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 12-17-2015 10:39 AM

    Okay, i'll explain you the cleanest way to achieve it. Without text_api, wich is, in my opinion, crappy. And no offense to cdtj (your skills impress me everyday), but i personnaly think that this is not a good idea to always customize and try to achieve everything with SDM.

     

    I'm currently doing exactly what i'll explain to you. The easiest way is to use CA API Management. (Layers7). But if you don't have it, you can create a webService. Choose your language.

     

    Define a webmethod that ask for ticket ID and new status as Input. And then, inside your custom webService, call the SDM webservice, get your SID, and perform the status update.

     

    This webMethod will be called from your email, with an URL, wich contains your needed parameters, added by the SDM in the notification.

     

    When you create the notification, you can add the id and the new status in the URL of your href.

    EX :

    <a href="http://yourWebServer/yourWebService/updateTicketStatusFromEmail?ticketID=@{call_req_id.id}&newStatusCode=CL"><img src="likeButton.png"/></a>

    <a href="http://yourWebServer/yourWebService/updateTicketStatusFromEmail?ticketID=@{call_req_id.id}&newStatusCode=REOPEN"><img src="dislikeButton.png"/></a>

     

    Maybe it looks like a lot of job but trust me, once this is done, it will be easier to integrate other software with SDM.



  • 8.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 12-18-2015 07:33 AM

    pier-olivier.tremblay i will try this right now!!

    My customer gave me until monday to this feature is working!!

    I've never worked with web services so far, but will do my best to make it work once and for all using all the tips you gave me!!

    Thanx again!!

    cdtj many, many, many thanx for all ideias you gave me too!!!!!!



  • 9.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 12-21-2015 04:21 PM

    Guys, im back!!!!! o/

     

    I am trying to implement web services to be able to close the ticket and came across some erros.

     

    To be honest, I do not understand the creation of the VB code, I took some references in some forums but I'm not having much success.

     

    Could help please!!?!

     

    VB code:

     

    Class Page1

        Dim ws As New WebReference.USD_WebService

        ws.Url = http://hummer:8080/axis/services/USD_R11_WebService?wsdl

        Dim username, password As String

        Dim sid As Integer

        username = "servicedesk"

        password = "Mais2x123"

        sid = ws.login(username, password)

        Dim USD As New localhost.USD_WebService 'Referência do WebService do CA USD

        Sid = USD.login(User, pass) ‘Login no USD, pega session ID

        Dim ticket_handle As String = “cr:1001” USD.closeTicket(Sid, “ticket fechado”, ticket_handle)

    End Class

     

     

    Project Visual Studio:

     

    3.png

    2.png

    1.png



  • 10.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 12-17-2015 10:16 AM

    Hi,

    my opinion is that you are going a hardest way.

     

    The easiest (for me, sure ) way is to perform all actions on SDM side,

    1. I have created derived table to keep users satisfaction evaluation and linked object, this needs to avoid object update restrictions based on role;

    2. Link looks like :

    pdmweb.exe?OP=CREATE_NEW+FACTORY=z_eval+PRESET=iss:@{issue_id.persistent_id}+KEEP.z_eval=1

    Where I predefined my evaluated object and its score.

    3. HTMPL page displays "Thanks for leaving feedback for object {OBJ_NUM}". All actions are performed on background.

     

    Also there is possibility to make shorter version of this,

    build a link to status change form with predefined params like status, evaluation and HTMPL form,

    once form is opened, publish it with autosave macro.

     

    But all of this solutions needs to open URL instead of sending email.

     

    Regards,

    cdtj



  • 11.  Re: Customize Notification Message - "Like" "Unlike" Facebook (Close and Reopen ticket)!!! =O

    Posted 12-29-2015 12:40 PM

    Guys!!!!!

     

    After reading and re-reading the code and understand a little about the variables and what makes each function, the code that i mentioned worked!!

     

    My friend, AlbinoSerafimVas81982988 help me a lot to understand how the SDM´s  WS works.

     

    I appreciate immensely the help of everyone!!!!!!!

     

    Many, many, thanx!!!!