<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Attach Knowledge Client script SOW in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3164494#M1175913</link>
    <description>&lt;P&gt;I have the below client script to update the URL of the article so that it provides the service portal view of the article since most user cannot see it in the standard UI. It does not work in Service Operations Workspace. Is there some other place I would need to use this code so it works in SOW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    //Type appropriate comment here, and begin script below
    if (newValue.includes('kb_view.do')) {
        g_form.getReference('caller_id', company);
    }
}

function company(caller){
	if (caller.company == '357bc3411b39d8503d4477761a4bcbaa'){
		
		var comment = g_form.getValue('comments');

        // retrieve KB link between [code] blocks
        var commentLink = comment.substring(
            comment.lastIndexOf('[code]') + 6,
            comment.lastIndexOf('[/code]')
        );

        // retrieve KB number from URL
        var kbNumberSub = commentLink.match(' &amp;gt;(.*) : ')[1];
        var kbNumber = trim(kbNumberSub);
		
		//call script include to verify if self-service kb
        var ga = new GlideAjax('CheckKnowledgeBase');
        ga.addParam('sysparm_name', 'isSelfService');
        ga.addParam('sysparm_number', kbNumber);
        ga.getXML(isSelfServiceParse);
	}
	else{
		alert('This user is not an employee and does not have access to view KAs');
		g_form.clearValue('comments');
	}
}

function isSelfServiceParse(response) { //Verify responce is true and set comments if correct.
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer == "true") {
        var comment = g_form.getValue('comments');
        g_form.setValue("comments", comment.replace("kb_view.do?sys_kb_id", "prism?id=kb_article&amp;amp;sys_id"));
    } else {
        var userGA = new GlideAjax('getUserData');
        userGA.addParam('sysparm_name', 'checkFulfiller');
        userGA.addParam('sysparm_user_sys', g_form.getValue('caller_id'));
        userGA.getXML(checkFulfillerParse);
    }
}

function checkFulfillerParse(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer == "false") {
        g_form.clearValue('comments');
        alert("The KA you tried to attach is for fulfillers only. The caller cannot view this article.");
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2025 20:50:16 GMT</pubDate>
    <dc:creator>brianlan25</dc:creator>
    <dc:date>2025-01-30T20:50:16Z</dc:date>
    <item>
      <title>Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3164494#M1175913</link>
      <description>&lt;P&gt;I have the below client script to update the URL of the article so that it provides the service portal view of the article since most user cannot see it in the standard UI. It does not work in Service Operations Workspace. Is there some other place I would need to use this code so it works in SOW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    //Type appropriate comment here, and begin script below
    if (newValue.includes('kb_view.do')) {
        g_form.getReference('caller_id', company);
    }
}

function company(caller){
	if (caller.company == '357bc3411b39d8503d4477761a4bcbaa'){
		
		var comment = g_form.getValue('comments');

        // retrieve KB link between [code] blocks
        var commentLink = comment.substring(
            comment.lastIndexOf('[code]') + 6,
            comment.lastIndexOf('[/code]')
        );

        // retrieve KB number from URL
        var kbNumberSub = commentLink.match(' &amp;gt;(.*) : ')[1];
        var kbNumber = trim(kbNumberSub);
		
		//call script include to verify if self-service kb
        var ga = new GlideAjax('CheckKnowledgeBase');
        ga.addParam('sysparm_name', 'isSelfService');
        ga.addParam('sysparm_number', kbNumber);
        ga.getXML(isSelfServiceParse);
	}
	else{
		alert('This user is not an employee and does not have access to view KAs');
		g_form.clearValue('comments');
	}
}

function isSelfServiceParse(response) { //Verify responce is true and set comments if correct.
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer == "true") {
        var comment = g_form.getValue('comments');
        g_form.setValue("comments", comment.replace("kb_view.do?sys_kb_id", "prism?id=kb_article&amp;amp;sys_id"));
    } else {
        var userGA = new GlideAjax('getUserData');
        userGA.addParam('sysparm_name', 'checkFulfiller');
        userGA.addParam('sysparm_user_sys', g_form.getValue('caller_id'));
        userGA.getXML(checkFulfillerParse);
    }
}

function checkFulfillerParse(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer == "false") {
        g_form.clearValue('comments');
        alert("The KA you tried to attach is for fulfillers only. The caller cannot view this article.");
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 20:50:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3164494#M1175913</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-01-30T20:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3164804#M1175977</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/423434"&gt;@brianlan25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try to debug by adding alerts what's the outcome?&lt;/P&gt;
&lt;P&gt;Did you try to use getXMLAnswer() for ajax?&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 07:23:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3164804#M1175977</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-01-31T07:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165404#M1176124</link>
      <description>&lt;P&gt;Tossed in some alerts. It appears to get to this code and then stopes working in SOW. Fulfiller Standard UI it works fine. I get the alert that says before retrieve kb number but the alert that should be the KB number I don't get.&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;alert('before retrieve kb number');&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;// retrieve KB number from URL&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; kbNumberSub = commentLink.match(&lt;/SPAN&gt;&lt;SPAN&gt;' &amp;gt;(.*) : '&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;];&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; kbNumber = trim(kbNumberSub);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;alert (kbNumber);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 Jan 2025 16:44:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165404#M1176124</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-01-31T16:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165446#M1176136</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/423434"&gt;@brianlan25&lt;/a&gt;&amp;nbsp; Try to validate match and trim method output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check browser console log&amp;nbsp; , see if any error coming due to the function used inside this client script.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;eg:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;alert('before retrieve kb number ' +  commentLink.match(' &amp;gt;(.*) : ')[1] ); 
// retrieve KB number from URL
var kbNumberSub = commentLink.match(' &amp;gt;(.*) : ')[1];
alert (' KB Number ' + trim(kbNumberSub) );
var kbNumber = trim(kbNumberSub);
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Harsh&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 17:43:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165446#M1176136</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2025-01-31T17:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165474#M1176141</link>
      <description>&lt;P&gt;I get the before retrieve KB number. But not the other alert you suggested. These appear in the console log right after the alert before retrieve KB Number.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrianLancaster_0-1738347663754.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/416392i2D12E754E0483EC4/image-size/medium?v=v2&amp;amp;px=400" alt="BrianLancaster_0-1738347663754.png" title="BrianLancaster_0-1738347663754.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 18:22:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165474#M1176141</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-01-31T18:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165521#M1176156</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/423434"&gt;@brianlan25&lt;/a&gt;&amp;nbsp; Looks like some other dom script creating this error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you try to comment the trim() method line to check the result of ajax ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also try to disable this script to check if you are getting this console error ? on native UI view you are not seeing the same console error ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 19:41:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165521#M1176156</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2025-01-31T19:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165529#M1176158</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/423434"&gt;@brianlan25&lt;/a&gt;&amp;nbsp;&amp;nbsp;trim() should be used like this way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;syntax :&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;String.prototype.trim()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;eg:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;alert (' KB Number ' + kbNumberSub.trim());&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 19:51:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165529#M1176158</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2025-01-31T19:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165657#M1176190</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/112287"&gt;@hvrdhn88&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So there are absolutely no error when running this in the regular UI. Once I changed the trim code to v&lt;SPAN&gt;ar&lt;/SPAN&gt;&lt;SPAN&gt; kbNumber = kbNumberSub.trim(); this section of code started working in SOW.&amp;nbsp; However the code for the function was doing anything. So I&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;made another adjustment to the code in the GlideAjext response function. It now looks like this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="javascript"&gt;function isSelfServiceParse(response) { //Verify responce is true and set comments if correct.
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer == "true") {
        var comment = g_form.getValue('comments');
	var newComment = comment.replace("kb_view.do?sys_kb_id", "prism?id=kb_article&amp;amp;sys_id"); //this is the new code
        g_form.setValue("comments", newComment); //this has been setup to use the new variable.
    } else {
        var userGA = new GlideAjax('getUserData');
        userGA.addParam('sysparm_name', 'checkFulfiller');
        userGA.addParam('sysparm_user_sys', g_form.getValue('caller_id'));
        userGA.getXML(checkFulfillerParse);
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;Now I can see the comments actually being updated (screenshot below) but for some reason it still posts the comments with the kb_view.do URL instead of the portal URL.&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrianLancaster_0-1738359780037.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/416417iE2214CF8C5B64DD0/image-size/medium?v=v2&amp;amp;px=400" alt="BrianLancaster_0-1738359780037.png" title="BrianLancaster_0-1738359780037.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 01 Feb 2025 00:18:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165657#M1176190</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-02-01T00:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165677#M1176195</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/423434"&gt;@brianlan25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;why not return the portal URL from the script include function itself?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2025 03:20:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165677#M1176195</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-02-01T03:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165881#M1176259</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/423434"&gt;@brianlan25&lt;/a&gt;&amp;nbsp; As far as i know, if you are passing any parameter inside trim() which is not correct. at least vanilla JS trim() does not allow it , i have seen on lodash trim we can but that has different naming convention. at least on workspace it is giving an error which is good.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;add alert to check the newComment variable value value ? is this onChange client script on comment field ? if not then try to do validation on script include and use getJournalEntry() to access the comment data .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just checked on PDI and it is replacing it on activity as well as on comment box.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Harsh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2025 19:22:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3165881#M1176259</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2025-02-01T19:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3167052#M1176569</link>
      <description>&lt;P&gt;My script include only returns true of false based on if it is a Self Service KB article or not. How would I get it to return both. Also the script appears to be updating the comments as I can see it display the updated URL but it is almost like the comment is being committed a spit second before the update the comment. See screenshot below with the correct URL in the comments.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrianLancaster_1-1738603247431.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/416760iEF06CA349EFBD127/image-size/medium?v=v2&amp;amp;px=400" alt="BrianLancaster_1-1738603247431.png" title="BrianLancaster_1-1738603247431.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my script include:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="javascript"&gt;var CheckKnowledgeBase = Class.create();
CheckKnowledgeBase.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    isSelfService: function() { //function to verify if a KA is in the Self-Service Knowledge Base
        var number = this.getParameter('sysparm_number');
        var gr = new GlideRecord('kb_knowledge');//Glide Record query to search for the KB Article
        gr.addQuery('number', number);
        gr.query();
        if (gr.next()) {
            if (gr.kb_knowledge_base.getDisplayValue() == "Self-Service") {//Check if artical is part of the Knowledge base.
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    },
    type: 'CheckKnowledgeBase'
});&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Feb 2025 17:00:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3167052#M1176569</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-02-04T17:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3168278#M1176833</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/112287"&gt;@hvrdhn88&lt;/a&gt;&amp;nbsp;can you share your code that you use in your PDI?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 17:02:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3168278#M1176833</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-02-04T17:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3168453#M1176863</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/423434"&gt;@brianlan25&lt;/a&gt;&amp;nbsp; I just tried to use onChange client script on comment field, if i mention any url it should replace to different url and that has updated the correct result.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.gif"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/417158i4059DF02D3115660/image-size/medium?v=v2&amp;amp;px=400" alt="Untitled.gif" title="Untitled.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried to reproduce it on your PDI ? your updated script looks fine to me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 19:56:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3168453#M1176863</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2025-02-04T19:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3169401#M1177150</link>
      <description>&lt;P&gt;That isn't a real test because you are not using the attach article functionality you are just posting a comment.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 16:53:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3169401#M1177150</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-02-05T16:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Attach Knowledge Client script SOW</title>
      <link>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3169457#M1177159</link>
      <description>&lt;P&gt;Ok so I brought all my script over into my PDI. It does the same thing. Where you see it change the comments but what is posted is not correct. If I comment everything out in my script and just do the 3 lines of code it works.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var comment = g_form.getValue('comments');
var newComment = comment.replace("kb_view.do?sys_kb_id", "prism?id=kb_article&amp;amp;sys_id");
 g_form.setValue("comments", newComment);&lt;/LI-CODE&gt;
&lt;P&gt;Seems to be some sort of timing issues. The question now is how do I get around it.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 17:47:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/attach-knowledge-client-script-sow/m-p/3169457#M1177159</guid>
      <dc:creator>brianlan25</dc:creator>
      <dc:date>2025-02-05T17:47:39Z</dc:date>
    </item>
  </channel>
</rss>

