IT Process Automation

 View Only
Expand all | Collapse all

Html Format in PAM operator Output

  • 1.  Html Format in PAM operator Output

    Posted Jan 05, 2016 05:22 AM

    Hi,

     

    I am using 4.2 Pam version, I want my SD ticket to have some html format description like tables or font change. But  pam Operator doesnt work for any html tags.

    Same I can use in Email operator and there is option to Send in HTML format. can anyone suggest how to add html tags in operators so it works.



  • 2.  Re: Html Format in PAM operator Output

    Posted Jan 05, 2016 07:16 AM

    Try to replace special unsupported characters, for example replace "<" character with &lt;

    For more characters see for example this web site



  • 3.  Re: Html Format in PAM operator Output

    Posted Jan 05, 2016 07:45 AM

    Thanks for the reply . My concern here is with html tags. If i add html tags its not rendering its just Printing how it is.



  • 4.  Re: Html Format in PAM operator Output

    Broadcom Employee
    Posted Jan 05, 2016 08:35 AM

    Milan is referring to the html tags.  You need to encode the special characters in the html (<, >, & and some others).  Instead of this in the description:

     

    click <a href="www.google.com">here</a>

     

    you should use

     

    click &lt; href="www.google.com"&gt;here&lt;/a&gt;



  • 5.  Re: Html Format in PAM operator Output

    Posted Jan 08, 2016 03:56 AM

    Hi,

     

    I tried same code but it throws below error:

     

    Failed to execute code:
    var txt="click &lt; a href="www.google.com"&gt;here&lt;/a&gt;";

    Process.SD=txt;


    -- missing ; before statement (#2)



  • 6.  Re: Html Format in PAM operator Output

    Posted Jan 08, 2016 09:31 AM

    Since you're using Javascript to write HTML statement, you need to replace double quotes with single quotes in your HTML statement :

     

    SO this HTML statement :

     

    <a href="www.google.com">Google</a>

     

    Used in javascript will look like :

     

    var htmlStatement = "<a href='www.google.com'>Google</a>";

     

    And you do not need to encode your character to pass them to ServiceDesk. Just use a CDATA tag around your values.

     

    So it should looks like :

     

    var htmlStatement = "<![CDATA[<a href='www.google.com'>Google</a>]]>";



  • 7.  RE: Re: Html Format in PAM operator Output

    Posted Dec 03, 2023 12:56 PM

    $result = Invoke-WebRequest -Method Get -Uri $url_data -UseBasicParsing
    $output = [System.Net.WebUtility]::HtmlDecode($result.Content)

    May be this will work to handle using runscript.




  • 8.  Re: Html Format in PAM operator Output

    Broadcom Employee
    Posted Jan 05, 2016 08:47 AM

    This is correct.   Process Automation allows you to write JavaScript into your process, therefor PAM cannot automatically determine if a character is part of the code being written or part of a URL within the code and you must specifically tell PAM when a character is just a character and not coding.

     

    This tech doc explains this in a bit more detail:  TEC1707193 "Special Characters in Process Automation"

     

    Ultimately using encodeURI(), or encodeURIComponent() should allow you to encode your url easily.



  • 9.  Re: Html Format in PAM operator Output

    Broadcom Employee
    Posted Jan 05, 2016 09:01 AM

    I have reread this, I think we have all misunderstood your question.   Are you asking for Process Automation to send HTML formatted code into a Service Desk ticket and have that text set as a clickable, or BOLD format within Service Desk? 

     

    If this is the case the first question is, Can this be done through the Service Desk API?   PAM can definitely be used to send any characters over to Service Desk, you may need to do some encoding, but unless Service Desk will display this correctly it doesn't matter what we put into Process Automation.

     

     

    Unfortunately, If I am remembering correctly, I do not believe that you can put a URL link in Service Desk Description fields.

    If you simply enter into a Service Desk ticket's Description field:

     

         <a href="www.google.com">Google URL</a>

     

    Does that display as a link to Google URL? 

     

     

    Then, can that be set via the Service Desk API?

     

    I would suggest first verifying that you can use HTML code within Service Desk, then verify that the same can be set through the API using SOAPUI.



  • 10.  Re: Html Format in PAM operator Output

    Posted Jan 08, 2016 02:59 AM

    Hi,

     

    Yes I want to send HTML description to SD ticket. But as you ppl suggest I have to use special characters.



  • 11.  Re: Html Format in PAM operator Output
    Best Answer

    Posted Jan 06, 2016 03:46 PM

    Hi everyone, first answer here, i'm from the Service Management forum

     

    Yes, SDM support the rendering of HREF in description field, but this is the only supported html tag that i know!

     

    You need to use the attribut keeplinks=yes when you define your pdm_macro for the ticket description

     

    <PDM_MACRO name=dtlTextbox hdr="Description" attr=description colspan=4 keeplinks=yes make_required="yes" rows=15 size=180 spellchk=yes>

     

    Do not forget to include your description into a CDATA tag since everything is sent to SDM via XML.

     

    Here's how i do it :

     

    var reqURL = Process.gblDSVals.SLCM_URL + "/usm/wpf?Node=icguinode.requestprofile&Args=" + Process.SLCM_RequestID__ + "&KEEP_returnNode=null";

    var hyperLink = '<a href="' + reqURL + '" target=blank>' + Process.SLCM_RequestID__ + '</a>';

    Process.ticketDescriptionHeaderEN = "<![CDATA[Request No " + hyperLink + " from Service Catalog.\n\nService Name: " + serviceNameEN + " ]]>\n\n";

     

     

    Regards,



  • 12.  Re: Html Format in PAM operator Output

    Posted Jan 08, 2016 03:28 AM

    Hi All,

     

    I tried with htm bold tag ,but I am getting output as below

     

    &lt;b&gt;The original string: &lt;/b&gt;

     

    In pam in JavaScript code I have written below code

     

    var txt = "&lt;b&gt;The Original String:&lt;/b&gt;"

     

    Its not able render the string to bold tag.



  • 13.  Re: Html Format in PAM operator Output

    Broadcom Employee
    Posted Jan 08, 2016 08:21 AM

    Per POssq's post the only supported HTML tags in Service Desk descriptions fields are HREF tags.   This will be an enhancement request for Service Desk.   Jump over to the Service Desk communities IDEA area to create this request.

    CA Service Management