<?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 Issue with attachment comments updated by system not by the logged in user in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032142#M761</link>
    <description>&lt;P&gt;On change form when we used to attached the file in actives comments are updated by system it is not showing the logged in user. Those comments are coming from script actions. is there any way to update the name by logged in user instead of system ? All inputs are much appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2024 08:14:38 GMT</pubDate>
    <dc:creator>Kranthi Rohit</dc:creator>
    <dc:date>2024-08-30T08:14:38Z</dc:date>
    <item>
      <title>Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032142#M761</link>
      <description>&lt;P&gt;On change form when we used to attached the file in actives comments are updated by system it is not showing the logged in user. Those comments are coming from script actions. is there any way to update the name by logged in user instead of system ? All inputs are much appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 08:14:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032142#M761</guid>
      <dc:creator>Kranthi Rohit</dc:creator>
      <dc:date>2024-08-30T08:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032160#M762</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/507429"&gt;@Kranthi Rohit&lt;/a&gt;&amp;nbsp;If you are using the script action to update the comments then they will always be from system as the script actions are executed by system only. Instead of adding the comment using a script action, you can try adding it via an async business rule and the comment would be marked from the user's account.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;Please mark the response helpful and accepted solution if it manages to answer your question.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Aug 2024 08:35:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032160#M762</guid>
      <dc:creator>Sandeep Rajput</dc:creator>
      <dc:date>2024-08-30T08:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032229#M764</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/507429"&gt;@Kranthi Rohit&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still want to try in script action , You can try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1)Pass logged in user sys_id from your gs.eventQueue and impersonate it in the script action&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="HemanthM1_0-1725010247244.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/382673i669F2499C8CB4E7E/image-size/large?v=v2&amp;amp;px=999" role="button" title="HemanthM1_0-1725010247244.png" alt="HemanthM1_0-1725010247244.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2)Script Action:&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="HemanthM1_1-1725010287168.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/382675i2E6B8973DA63CB29/image-size/large?v=v2&amp;amp;px=999" role="button" title="HemanthM1_1-1725010287168.png" alt="HemanthM1_1-1725010287168.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HemanthM1_2-1725010342042.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/382678i170BB7B06163067C/image-size/large?v=v2&amp;amp;px=999" role="button" title="HemanthM1_2-1725010342042.png" alt="HemanthM1_2-1725010342042.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 09:33:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032229#M764</guid>
      <dc:creator>Hemanth M1</dc:creator>
      <dc:date>2024-08-30T09:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032281#M765</link>
      <description>&lt;P&gt;Hello Hemanth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion is much helpful we use the second one that displays as the guest instead of system, so please guide me . Where should we add the first script?&lt;/P&gt;&lt;P&gt;gs.event Queue("ptin",current,current.sys_id,gs.getUserID();&lt;BR /&gt;could you please navigate me in the instance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 10:06:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032281#M765</guid>
      <dc:creator>Kranthi Rohit</dc:creator>
      <dc:date>2024-08-30T10:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032292#M766</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/507429"&gt;@Kranthi Rohit&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know how the script action being called when attachment is added?? must be a Business Rule or flowdesigner, find that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There you can find gs.eventQueue, add gs.getUserID() paramter and go to script action &amp;gt;&amp;gt;the add impersonation logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 10:12:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032292#M766</guid>
      <dc:creator>Hemanth M1</dc:creator>
      <dc:date>2024-08-30T10:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032296#M767</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/507429"&gt;@Kranthi Rohit&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try bellow script in your action :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Get the current logged-in user
var currentUser = gs.getUserID();

// GlideRecord to update the active comments field (assuming the table is 'incident')
var gr = new GlideRecord('incident');
if (gr.get(current.sys_id)) {
    // Update the comments with the logged-in user's ID
    gr.comments = "File attached by " + gs.getUserName();  // Add your custom message here
    gr.setValue('sys_updated_by', gs.getUserName()); // Update sys_updated_by to the logged-in user
    gr.update(); // Update the record
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 30 Aug 2024 10:14:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032296#M767</guid>
      <dc:creator>Rajesh Chopade1</dc:creator>
      <dc:date>2024-08-30T10:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032311#M768</link>
      <description>&lt;P&gt;Hi Rajesh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response,&lt;/P&gt;&lt;P&gt;It's&amp;nbsp; taking the&amp;nbsp; current user as system by default. its not showing the logged in user name.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 10:32:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032311#M768</guid>
      <dc:creator>Kranthi Rohit</dc:creator>
      <dc:date>2024-08-30T10:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with attachment comments updated by system not by the logged in user</title>
      <link>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032347#M769</link>
      <description>&lt;P&gt;hi Hemanth,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to this script action , I don't how the script actions are called in BR /Flow designer I checked every where I couldn't find .If you know how it called and where it is?. Please navigate me to there. That would be really a great help for me. thanks&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 10:54:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/issue-with-attachment-comments-updated-by-system-not-by-the/m-p/3032347#M769</guid>
      <dc:creator>Kranthi Rohit</dc:creator>
      <dc:date>2024-08-30T10:54:46Z</dc:date>
    </item>
  </channel>
</rss>

