<?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 Re: Add sys_user_id to comments (sys_journal_field) in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871944#M528870</link>
    <description>&lt;P&gt;You can actually accomplish this without modfying any code or adding a new business rule. Just add a new field that references the user table and in the dictionary entry for the new field, set the default value field to javascript:gs.getUserID();. It will automatically pick up the user who made the comment without any extra rules.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 21 Mar 2012 14:59:05 GMT</pubDate>
    <dc:creator>Brad Tilton</dc:creator>
    <dc:date>2012-03-21T14:59:05Z</dc:date>
    <item>
      <title>Add sys_user_id to comments (sys_journal_field)</title>
      <link>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871940#M528866</link>
      <description>&lt;P&gt;I'm integrating a third party app with ServiceNow and am looking at showing the incident comments, along with a picture of the users which made the comments. The default sys_journal_field has a "created by" field, but this is only a text field (of the first.lastname). The issue is that the first.lastname is not unique in the system, so you do not know which user will be returned if you do a lookup for the user based solely on this field.&lt;BR /&gt;&lt;BR /&gt;I can add in the reference field (to sys_user) to the sys_journal_field, but am unsure of how/where to set this when a comment is created. Was wondering if anyone had any suggestions?&lt;BR /&gt;&lt;BR /&gt;Much obliged&lt;BR /&gt;Raja&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2012 14:58:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871940#M528866</guid>
      <dc:creator>rajabhadury</dc:creator>
      <dc:date>2012-03-20T14:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add sys_user_id to comments (sys_journal_field)</title>
      <link>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871941#M528867</link>
      <description>&lt;P&gt;You could add the reference field and then set its default value to &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;BR /&gt;javascript:getUserID();&lt;/PRE&gt;. It'll capture the user account that made created the journal entry.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Mar 2012 22:20:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871941#M528867</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2012-03-20T22:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add sys_user_id to comments (sys_journal_field)</title>
      <link>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871942#M528868</link>
      <description>&lt;P&gt;One clarification: sys_created_on is the user_name of the user who made the comment. Again, not necessarily unique, but probably moreso than first.last&lt;BR /&gt;&lt;BR /&gt;For comments, that's the identifier used since it won't be cleared if the user's sys_user record is subsequently deleted. A reference field will get cleared.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Mar 2012 22:31:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871942#M528868</guid>
      <dc:creator>CapaJ</dc:creator>
      <dc:date>2012-03-20T22:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add sys_user_id to comments (sys_journal_field)</title>
      <link>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871943#M528869</link>
      <description>&lt;P&gt;CapaJC - Yes, very true. It just happens our username fields are stored in the format first.lastname. I can definitely see the point if the user's record is deleted.&lt;BR /&gt;&lt;BR /&gt;b-rad - Exactly what I'd like to do! Ideally, I'd like to modify the code that is setting the parameters for the comment in the first place (and add in the user_id as well as what is on there currently), rather than creating a business rule which finds the last comment when an incident.comments.changes() and set the user_id there. Is this possible to do?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Mar 2012 09:17:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871943#M528869</guid>
      <dc:creator>rajabhadury</dc:creator>
      <dc:date>2012-03-21T09:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Add sys_user_id to comments (sys_journal_field)</title>
      <link>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871944#M528870</link>
      <description>&lt;P&gt;You can actually accomplish this without modfying any code or adding a new business rule. Just add a new field that references the user table and in the dictionary entry for the new field, set the default value field to javascript:gs.getUserID();. It will automatically pick up the user who made the comment without any extra rules.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Mar 2012 14:59:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871944#M528870</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2012-03-21T14:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add sys_user_id to comments (sys_journal_field)</title>
      <link>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871945#M528871</link>
      <description>&lt;P&gt;Ah, genius! Thanks very much Brad &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Mar 2012 15:13:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/add-sys-user-id-to-comments-sys-journal-field/m-p/1871945#M528871</guid>
      <dc:creator>rajabhadury</dc:creator>
      <dc:date>2012-03-21T15:13:35Z</dc:date>
    </item>
  </channel>
</rss>

