<?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: How to show UI action to only few Roles in Common Service Data Model forum</title>
    <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2445347#M4184</link>
    <description>&lt;P&gt;I tried that unfortunately it is not working&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 12:03:21 GMT</pubDate>
    <dc:creator>Purushotham9963</dc:creator>
    <dc:date>2023-01-17T12:03:21Z</dc:date>
    <item>
      <title>How to show UI action to only few Roles</title>
      <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2445329#M4182</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;i have created one UI Action on incident Table to created child tasks. and the Button ' create task' should be visible to only for few users who is having few custom roles.&lt;/P&gt;&lt;P&gt;And i am aware that we can achieve this if we give"gs.hasRole('contract_manager')&amp;nbsp; " in the condition field in UI action. But since we have many conditions we do not have any space left to give this in the condition field.&lt;/P&gt;&lt;P&gt;Can anyone please help me with the script to achieve this?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 11:42:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2445329#M4182</guid>
      <dc:creator>Purushotham9963</dc:creator>
      <dc:date>2023-01-17T11:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to show UI action to only few Roles</title>
      <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2445333#M4183</link>
      <description>&lt;P&gt;There is tab on a UI action where you can list the roles required to see the UI 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="MartinGrosskop_0-1673955879049.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/233167i7B4FF5FCECD3A012/image-size/medium?v=v2&amp;amp;px=400" alt="MartinGrosskop_0-1673955879049.png" title="MartinGrosskop_0-1673955879049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 11:45:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2445333#M4183</guid>
      <dc:creator>Martin Grosskop</dc:creator>
      <dc:date>2023-01-17T11:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to show UI action to only few Roles</title>
      <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2445347#M4184</link>
      <description>&lt;P&gt;I tried that unfortunately it is not working&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 12:03:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2445347#M4184</guid>
      <dc:creator>Purushotham9963</dc:creator>
      <dc:date>2023-01-17T12:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to show UI action to only few Roles</title>
      <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2965760#M6547</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Did you ever get an answer to this.&amp;nbsp; &amp;nbsp;It is not working for me.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Chad&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 03:55:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/2965760#M6547</guid>
      <dc:creator>purdue</dc:creator>
      <dc:date>2024-06-18T03:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to show UI action to only few Roles</title>
      <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/3019042#M6711</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Requires Roles works (I just confirmed it), however it does work in the same way ACLs do - a user can have&amp;nbsp;&lt;EM&gt;any&amp;nbsp;&lt;/EM&gt;of the roles listed, they do not need to have all the roles listed. Here is my configuration and it works as expected, the UI Action does not appear for users who do not have the role listed&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rebecca3_0-1723721639302.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/379504iC77C7E7ADBD8AAB9/image-dimensions/550x326?v=v2" alt="Rebecca3_0-1723721639302.png" title="Rebecca3_0-1723721639302.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have encountered issues with the character limitation on the Conditions field and a way around this is to move the logic to a script include and call the script include in the condition check - ServiceNow even does this, an example is the 'Assign to me' out-of-box UI action installed with ITSM Workspace (sys id =&amp;nbsp;e44b67f63b330300a2bac9bb34efc46a)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rebecca3_1-1723721903093.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/379505iF339F55150844352/image-dimensions/626x238?v=v2" alt="Rebecca3_1-1723721903093.png" title="Rebecca3_1-1723721903093.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rebecca3_2-1723721951345.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/379506iBE92CFF9392408C7/image-dimensions/546x385?v=v2" alt="Rebecca3_2-1723721951345.png" title="Rebecca3_2-1723721951345.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rebecca&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 11:41:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/3019042#M6711</guid>
      <dc:creator>Rebecca3</dc:creator>
      <dc:date>2024-08-15T11:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to show UI action to only few Roles</title>
      <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/3019047#M6712</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/489872"&gt;@Purushotham9963&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;'we have many conditions we do not have any space left to give this in the condition field.'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are 2 ways you can over come when you have no space left on condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1 Easy way :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Create a duplicate ui of the existing UI Action and on the duplicate UI action remove all the condition and place only the condition for which there was no space left.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. Scripted Way:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Create a script include with all the conditions and call the script include in UI action.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now the choice is yours... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 11:49:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/3019047#M6712</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2024-08-15T11:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to show UI action to only few Roles</title>
      <link>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/3019066#M6713</link>
      <description>&lt;P&gt;#1 won't work if the logic is all ANDs and not ORs because it's evaluated separately - a simple example, if you have &lt;EM&gt;current.state == 3 and gs.isMemberOf(current.assignment_group)&lt;/EM&gt; and you separate this into two different actions, the UI action will show any time the state is 3 regardless of whether the logged in user is a member of the assignment group. The second action will also show for anyone who is a member of the assignment group, so those people will see two UI actions and not know the difference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It also means you are duplicating code in more than one place which becomes harder to maintain over time.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 12:31:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/common-service-data-model-forum/how-to-show-ui-action-to-only-few-roles/m-p/3019066#M6713</guid>
      <dc:creator>Rebecca3</dc:creator>
      <dc:date>2024-08-15T12:31:22Z</dc:date>
    </item>
  </channel>
</rss>

