<?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 I have queried the Incident table with help of Glide system method , getUser() used in background script . in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/i-have-queried-the-incident-table-with-help-of-glide-system/m-p/1406807#M63733</link>
    <description>&lt;P&gt;I had written background script on 'Incident Table ' and I have also used Glide system API . in this I have used method various method but one method is "getUser() " used and&amp;nbsp; I can't understand the output of this method . I have also attached screen shot and highlighted output part below , can anyone explain me about this getUser() method output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var gr =new GlideRecord('incident');&lt;BR /&gt;gr.addQuery('active','true');&lt;BR /&gt;gr.query();&lt;BR /&gt;while(gr.next())&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;gs.print(gr.number);&lt;BR /&gt;gs.print('test');&lt;BR /&gt;if(gs.hasRole('itil_admin')){&lt;BR /&gt;gs.addInfoMessage('getUserName()retruns:' +gs.getUserName());&lt;BR /&gt;gs.addInfoMessage('getUser()retruns:'+gs.getUser());&lt;BR /&gt;gs.addInfoMessage('getUserDisplayName()returns:' +gs.getUserDisplayName());&lt;BR /&gt;gs.addInfoMessage('getUserID()returns:' +gs.getUserID());&lt;BR /&gt;gs.addInfoMessage('testing');&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;output :-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/142562iB66E1F613D25EC8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&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;
&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;
&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;
&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2022 10:25:09 GMT</pubDate>
    <dc:creator>Piyush  Kumar</dc:creator>
    <dc:date>2022-04-27T10:25:09Z</dc:date>
    <item>
      <title>I have queried the Incident table with help of Glide system method , getUser() used in background script .</title>
      <link>https://www.servicenow.com/community/developer-forum/i-have-queried-the-incident-table-with-help-of-glide-system/m-p/1406807#M63733</link>
      <description>&lt;P&gt;I had written background script on 'Incident Table ' and I have also used Glide system API . in this I have used method various method but one method is "getUser() " used and&amp;nbsp; I can't understand the output of this method . I have also attached screen shot and highlighted output part below , can anyone explain me about this getUser() method output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var gr =new GlideRecord('incident');&lt;BR /&gt;gr.addQuery('active','true');&lt;BR /&gt;gr.query();&lt;BR /&gt;while(gr.next())&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;gs.print(gr.number);&lt;BR /&gt;gs.print('test');&lt;BR /&gt;if(gs.hasRole('itil_admin')){&lt;BR /&gt;gs.addInfoMessage('getUserName()retruns:' +gs.getUserName());&lt;BR /&gt;gs.addInfoMessage('getUser()retruns:'+gs.getUser());&lt;BR /&gt;gs.addInfoMessage('getUserDisplayName()returns:' +gs.getUserDisplayName());&lt;BR /&gt;gs.addInfoMessage('getUserID()returns:' +gs.getUserID());&lt;BR /&gt;gs.addInfoMessage('testing');&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;output :-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/142562iB66E1F613D25EC8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&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;
&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;
&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;
&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 10:25:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/i-have-queried-the-incident-table-with-help-of-glide-system/m-p/1406807#M63733</guid>
      <dc:creator>Piyush  Kumar</dc:creator>
      <dc:date>2022-04-27T10:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: I have queried the Incident table with help of Glide system method , getUser() used in background script .</title>
      <link>https://www.servicenow.com/community/developer-forum/i-have-queried-the-incident-table-with-help-of-glide-system/m-p/1406808#M63734</link>
      <description>&lt;P&gt;getUser returns a user object with soecific attributes, so you need to do something like e.g. gs.getUser().getEmail();&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.servicenow.com/dev.do#!/reference/api/sandiego/server_legacy/GUserAPI?navFilter=getemail"&gt;https://developer.servicenow.com/dev.do#!/reference/api/sandiego/server_legacy/GUserAPI?navFilter=getemail&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If you need the sys_id of the suer, it is better to use gs.getUserID();&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.servicenow.com/dev.do#!/reference/api/sandiego/server_legacy/c_GlideSystemAPI#r_GS-getUserID?navFilter=getuserid"&gt;https://developer.servicenow.com/dev.do#!/reference/api/sandiego/server_legacy/c_GlideSystemAPI#r_GS-getUserID?navFilter=getuserid&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 10:29:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/i-have-queried-the-incident-table-with-help-of-glide-system/m-p/1406808#M63734</guid>
      <dc:creator>Tom Sienkiewicz</dc:creator>
      <dc:date>2022-04-27T10:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: I have queried the Incident table with help of Glide system method , getUser() used in background script .</title>
      <link>https://www.servicenow.com/community/developer-forum/i-have-queried-the-incident-table-with-help-of-glide-system/m-p/1406809#M63735</link>
      <description>&lt;P&gt;Hi Piyush,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;SPAN class="keyword apiname"&gt;gs.getUser()&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;method returns a user object. So you can fetch logged-in users details by using this object.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="kwd"&gt;var&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="pln"&gt; userOBJ&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; gs&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;getUser&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pln"&gt;gs&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.­&lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(­&lt;STRONG&gt;&lt;SPAN class="pln"&gt;userOBJ&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.­&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;getFirstName&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;());&lt;/SPAN&gt; &lt;SPAN class="com"&gt;//print the first name of the user&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN class="com"&gt;Kindly mark correct and helpful if applicable&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 10:36:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/i-have-queried-the-incident-table-with-help-of-glide-system/m-p/1406809#M63735</guid>
      <dc:creator>Chetan Mahajan</dc:creator>
      <dc:date>2022-04-27T10:36:50Z</dc:date>
    </item>
  </channel>
</rss>

