<?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>post Documenting ServiceNow Code with JSDoc Standards in Developer Advocate Blog</title>
    <link>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/ba-p/3195822</link>
    <description>&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true" data-pm-slice="1 1 []"&gt;In ServiceNow development, proper documentation is crucial for maintaining code quality and ensuring that functions are easily understandable by other developers. For me, I prefer using JSDoc standards for documenting my code, so let me give you a brief rundown in case you’ve never heard of it.&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true" data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true" data-pm-slice="1 1 []"&gt;&lt;STRONG&gt;This blog post is split into two parts: explaining my JSDoc process, and then a full + real example of me performing this process on a script include I wrote.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true" data-pm-slice="1 1 []"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1 id="bh-b-p-SPVTZNm6hjDcTp-pg" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Importance of JSDoc&lt;/H1&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;JSDoc is basically a markup language used to annotate JavaScript source code files, making it easier to understand the purpose and functionality of various functions and methods. By adhering to JSDoc standards, ServiceNow developers can create solid documentation that serves as a reference for both current and future team members. This practice not only improves code readability but also facilitates smoother onboarding for new developers.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Plus, with a little help of generative AI I can generate JSDoc comments quickly, and then with my newly documented code, I can generate separate, stand-alone documentation quickly so that my teammates never have to jump into the script include in the first place.&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1 id="bh-nISK0FrbDQ1DrtFNrDrCv" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;My Script Include + JSDoc process&lt;/H1&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL id="bh-d4jx4tpN-Q5iI90nZEm5h" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;
&lt;LI id="bh-i4dFoRSxeJD80D462wk4j" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Write my Script Include as normal&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh--R4rC2V11171XSaQAlvkX" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Have an LLM generate the JSDoc markup&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh-bhAE1c8a-diMpMovHbySN" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Correct any mistakes&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh-gjYPEBj6JsfPJL_FqI9GN" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Have an LLM generate stand-alone documentation&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&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="Documenting ServiceNow Code with JSDoc Standards - visual selection.png" style="width: 776px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424000i1D8B2CA793115655/image-size/large?v=v2&amp;amp;px=999" role="button" title="Documenting ServiceNow Code with JSDoc Standards - visual selection.png" alt="Documenting ServiceNow Code with JSDoc Standards - visual selection.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1 id="bh-mM_O92ZZmAXaI2MB_qdwN" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Basic JSDoc Syntax&lt;/H1&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;To effectively document your ServiceNow scripts or understand the syntax when you encounter it, familiarize yourself with the basic syntax of JSDoc. Here are the basics:&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="bh-AVM1TxsCT3ABFMBSUBdv3" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Function Documentation&lt;/H2&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;When documenting a function, you should include the following tags:&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL id="bh-fyEGyUpUfMJg7h2x9-poG" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;
&lt;LI id="bh-Vv0L2I3U5gGC2yydolxDj" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;CODE&gt;@function&lt;/CODE&gt;: Indicates the name of the function.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh-KoxJaqE7yJ-LkV6fFPGNw" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;CODE&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/2144"&gt;@Param&lt;/a&gt;&lt;/CODE&gt;: Describes the parameters the function accepts.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh-y4sYdepwKUOrcRU__vosY" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;CODE&gt;@returns&lt;/CODE&gt;: Specifies the return value of the function.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Example:&lt;/H3&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE id="bh-SeQcBRqY65AnFQChoDwCN" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;CODE class="language-javascript"&gt;/**
 * Calculates the total price of items in the cart.
 * @function calculateTotal
 * @param {Array} items - An array of item objects.
 * @returns {number} The total price of all items.
 */
function calculateTotal(items) {
    let total = 0;
    items.forEach(item =&amp;gt; {
        total += item.price;
    });
    return total;
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="bh-ABUQxO6igcXGPU62RwPEv" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Documenting Variables and Objects&lt;/H2&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;You can also document variables and objects using JSDoc:&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE id="bh-jFADA1DlgEBWDBF5CZgxP" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;CODE class="language-javascript"&gt;/**
 * Represents a shopping cart item.
 * @typedef {Object} CartItem
 * @property {string} name - The name of the item.
 * @property {number} price - The price of the item.
 */

/**
 * An array of items in the shopping cart.
 * @type {Array&amp;lt;CartItem&amp;gt;}
 */
const cartItems = [];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1 id="bh-3BeYz2ZBu0QaZji8bSe6j" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Best Practices for JSDoc in ServiceNow&lt;/H1&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL id="bh-lP4j-oRyofcyROqn7Ur4n" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;
&lt;LI id="bh-5wgA879ICP8fri46Fcyqs" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;STRONG&gt;Be Consistent&lt;/STRONG&gt;: Use the same format and structure throughout your documentation to maintain clarity.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh-HNtm0yxMdwr7SbGIXRFDI" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;STRONG&gt;Keep it Updated&lt;/STRONG&gt;: Regularly update your JSDoc comments as your code evolves to ensure accuracy.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh-Pq1lsxSRh89aqat6eQ2T4" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;STRONG&gt;Use Descriptive Names&lt;/STRONG&gt;: Choose meaningful names for functions and parameters to make the documentation self-explanatory.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI id="bh-8UjTpGXdTiovjiikGk-eG" data-hook-type="blockHook"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;STRONG&gt;Include Examples&lt;/STRONG&gt;: Where applicable, provide examples of how to use functions to enhance understanding.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&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="Documenting ServiceNow Code with JSDoc Standards - visual selection (1).png" style="width: 938px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424001iB63F8516D477EC45/image-size/large?v=v2&amp;amp;px=999" role="button" title="Documenting ServiceNow Code with JSDoc Standards - visual selection (1).png" alt="Documenting ServiceNow Code with JSDoc Standards - visual selection (1).png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1 id="bh-bVCpvEJ6odwozCATHsjZU" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;A full example of me doing this last night&lt;/H1&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;I wrote this blog post up because just last night I finished building an integration between a ServiceNow instance and the ServiceNow Community platform.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="bh-CU5sdATFqp8jngcg39t2K" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;1. Wrote my code as normal&lt;/H2&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;I created a new Script Include in my PDI and set up several functions: some that I meant to be “public facing” (as in, my teammates would use them) and some were helper functions that would be called by other functions (never by other scripts).&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1 wrote my code.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424002iE62201276C5F0AE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="1 wrote my code.png" alt="1 wrote my code.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="bh-HwFxDRwaUfV9T7MqFEXiH" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;2. Generated JSDoc Markup&lt;/H2&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;I use both Cursor and ChatGPT 4o to do this step, especially because I built this on a PDI, but if you have access to Now Assist for Code, then that would work too.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;My prompt:&lt;/P&gt;
&lt;BLOCKQUOTE id="bh-2l5VDH54HajnXUJmNYlG1" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Generate JSDoc comments for these public facing functions: [list]&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Yeah, it’s a simple prompt, but JSDoc is so well documented and generative AI is smart enough to be able to understand your functions pretty well.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE id="bh-v3bpIPpcCfuULe2qHvqt9" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;CODE class="language-javascript"&gt;/**
     * Gets message information from the Khoros API for one or more message IDs
     * @param {string|string[]} messageId - Single message ID or array of message IDs to retrieve
     * @returns {Object|Object[]} Message information object(s) from the API response
     */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Notice how it even hinted that the input parameters could be a string or an array of string, it knew that I had scripted in that flexibility&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2 generated jsdoc.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424003i51509671DE8FEBC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2 generated jsdoc.png" alt="2 generated jsdoc.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="bh-A3869hTHmAvIxopQa6XO_" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;3. Correct Mistakes&lt;/H2&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;It’s generative AI, always take a look at what it produced for you and verify that it is correct. In this case, I didn’t find any mistakes actually.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="bh-mlVqGsFlx3BnQnRj9IaRO" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;4. Generate Stand-alone Documentation&lt;/H2&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Generally speaking, it’s good as-is if my goal was to provide easy to understand in-line documentation. Personally, I don’t want to force my teammates to visit the script include just to see what they need. So I take it a step further and generate stand-alone documentation. Again, generative AI makes this really easy.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;First, some prep work.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Usually, when I test my scripts to see if they work, I call my script include from other locations like Background Scripts or Business Rules, etc. I make sure to save all those calls and add them as a comment block at the end of my script include:&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3 call examples.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424004iFDB817E1FBBAD52B/image-size/large?v=v2&amp;amp;px=999" role="button" title="3 call examples.png" alt="3 call examples.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Why do I do this? Well, it helps with the following prompt:&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE id="bh-Z7oIDWYZWiUrdxOZn2-2_" dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Create markup documentation for the following ServiceNow Script include. Create a description, parameter and return explanation, and example usage for each of the follow public facing functions: [list]&lt;BR /&gt;&lt;BR /&gt;Then, create additional brief documentation for all other functions in the script include. These are internal helper functions, only to be described for posterity.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Then let the LLM do its magic! I take the generated documentation and throw it onto something like GitHub gists and now I can share it to my teammates for their future reference.&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4 stand alone doc.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424005i050326F4D5805E4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="4 stand alone doc.png" alt="4 stand alone doc.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;While you’re at it, this is where I tend to also provide sample returns. Especially if the return is a lengthy JSON object, then my teammates can create their code with my sample return object instead without having to run the call themselves first.&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5 example return.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/424006iE7769C23B5CB0A9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="5 example return.png" alt="5 example return.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P data-hook-type="blockHook" data-bubble-menu="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;Happy documenting!&lt;/P&gt;
&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true"&gt;- Earl&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 19:13:56 GMT</pubDate>
    <dc:creator>Earl Duque</dc:creator>
    <dc:date>2025-03-04T19:13:56Z</dc:date>
    <item>
      <title>Documenting ServiceNow Code with JSDoc Standards</title>
      <link>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/ba-p/3195822</link>
      <description>&lt;P dir="ltr" data-hook-type="blockHook" data-bubble-menu="true" data-pm-slice="1 1 []"&gt;In ServiceNow development, proper documentation is crucial for maintaining code quality and ensuring that functions are easily understandable by other developers. For me, I prefer using JSDoc standards for documenting my code, so let me give you a brief rundown in case you’ve never heard of it.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 19:13:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/ba-p/3195822</guid>
      <dc:creator>Earl Duque</dc:creator>
      <dc:date>2025-03-04T19:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Documenting ServiceNow Code with JSDoc Standards</title>
      <link>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/bc-p/3197851#M1315</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/91225"&gt;@Earl Duque&lt;/a&gt;&amp;nbsp;- Thank you for such wonderful blog about automated function documentation which is one of the best practice which many of the developers are not following. This automated approach really helps developers build meaning full coding.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question:- To generate the function documentation for the code, Hope we need to post the code which will be processed by the ChatGPT or other AI platform. Do we need to consider or have any mechanism to sanitize the code before we post to ChatGPT or other AI Platform?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be great If you suggest any guardrail that can be established to avoid any compliance issue for such automated approach.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 09:16:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/bc-p/3197851#M1315</guid>
      <dc:creator>Vasantharajan N</dc:creator>
      <dc:date>2025-03-06T09:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Documenting ServiceNow Code with JSDoc Standards</title>
      <link>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/bc-p/3200144#M1317</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/284514"&gt;@Vasantharajan N&lt;/a&gt;&amp;nbsp; one way to address compliance concern is to deploy LLM locally on midserver and consume LLM services from there, that way you are still using the power of GENAI but the data never leaves client environment. You can refer to below community article on how to setup GENAI solution onprem using midserver.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-blog/servicenow-genai-solution-using-ollama-api/ba-p/2926471" target="_blank" rel="noopener"&gt;ServiceNow GENAI solution using Ollama API - ServiceNow Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Mar 2025 06:14:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/bc-p/3200144#M1317</guid>
      <dc:creator>VaranAwesomenow</dc:creator>
      <dc:date>2025-03-08T06:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Documenting ServiceNow Code with JSDoc Standards</title>
      <link>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/bc-p/3324800#M1438</link>
      <description>&lt;P&gt;Hi Earl&lt;BR /&gt;Great article but, I'm on government contracts and can't use any of the LLM's.&lt;BR /&gt;How would I generate the final document in that case? I can manually add the comments without an LLM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 15:06:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-advocate-blog/documenting-servicenow-code-with-jsdoc-standards/bc-p/3324800#M1438</guid>
      <dc:creator>Dave65</dc:creator>
      <dc:date>2025-07-17T15:06:04Z</dc:date>
    </item>
  </channel>
</rss>

