IT Process Automation

  • 1.  Create ticket with '&' characters

    Posted Jan 08, 2013 10:58 AM
    Hi everyone,

    I have the SDM Connector for PAM4.0SP1 and I use the 'Request Create'' object to create a ticket.
    It works fine, but when I have a field where the value have some characters like '&' it fails.
    How can I solve it?

    Regards,
    Sérgio Castro


  • 2.  RE: Create ticket with '&' characters
    Best Answer

    Posted Jan 08, 2013 11:16 AM
    I have had the same issue with ampersands and any kinda of "html like" text, In general I deal with this in one of 2 ways.

    1. I wrap the text in a CDATA tag, example:
    "<![CDATA[" + Process.Summary + "]]>" 
    where Process.Summary is the variable that has the text with an ampersand in it.

    In the case of HTML when I don't want all the extra tags etc. in the Ticket I use something similar to:
    Process.Description.replace(/ /ig, ' ').replace(/<br\/?>/ig,"\n").replace(/<\/?[a-z][a-z0-9]*[^<>]*>/ig,"").replace('&', '+','g')
    which does not work in all cases but for the most part strips out all the html.