Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
UI Policy and Client Script not working on "Ticket Form" [ticket] page on Service Portal - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • UI Policy and Client Script not working on "Ticket Form" [ticket] page on Service Portal
KB0683191

UI Policy and Client Script not working on "Ticket Form" [ticket] page on Service Portal


5697 Views Last updated : Nov 11, 2024 public Copy Permalink
KB Summary by Now Assist

Description

A Catalog UI Policy or a Catalog Client Script to hide a catalog item variable do not work on the OOB "Ticket Form" [ticket] page on Service Portal.

 

Steps to Reproduce

 

  1. Navigate to Maintain Items > Apple iPad 3
    • /nav_to.do?uri=pc_hardware_cat_item.do?sys_id=060f3afa3731300054b6a3549dbe5d3e
  2. Create a New Variable "SP Test"
    • /nav_to.do?uri=item_option_new.do?sys_id=d89ed5b913047200efffb6004244b00b
      Type: Single Line Text
      Question: This variable is hidden by UI Policy
      Name: sp_ui_policy_test
      Default Value: This field should not be visible
  3. Create a Service Catalog UI Policy
    • /nav_to.do?uri=catalog_ui_policy.do?sys_id=035fddb913047200efffb6004244b0ea%26sysparm_view=advanced
      Applies to: A catalog Item
      Condition: none
      Applies on a Catalog Item view: true
      Applies on Catalog Tasks: true
      Applies on Requested Items: true
      On load: true
      Reverse if false: true
  4. Create a UI Policy Action to hide variable
    • /nav_to.do?uri=catalog_ui_policy_action.do?sys_id=31ff19f913047200efffb6004244b012%26sysparm_view=advanced
      Catalog Item: Apple IPad3
      Variable name: sp_ui_policy_test
      Visible: false
  5. Navigate to SP > Order Something > Apple iPad3 
    • /sp?id=sc_cat_item&sys_id=060f3afa3731300054b6a3549dbe5d3e
      Notice how the variable is hidden as expected:




  6. Submit an order
  7. Navigate to the requested item in the Ticket form [ticket]
    • /sp?id=ticket&table=sc_req_item&sys_id=3640a9f913047200efffb6004244b00c&view=sp
      Notice the variable is not hidden:


 
  • OOB ticket page (uses Ticket Fields widget):
    • /nav_to.do?uri=sp_page.do?sys_id=84af292247132100ba13a5554ee4909e
  • OOB Widget - Ticket Fields
    • /nav_to.do?uri=sp_widget.do?sys_id=5736bf52cb30020000f8d856634c9c2d
 
Notes:
  • Tested outside of SP - the UI Policy **works** directly on the sc_req_item form:
    • /nav_to.do?uri=sc_req_item.do?sys_id=2975e57113447200efffb6004244b005
  • Tried replacing the Catalog UI Policy with a Catalog Client Script
    • /nav_to.do?uri=catalog_script_client.do?sys_id=eb0769f113447200efffb6004244b062
Applies to: A catalog item
UI Type: All
Applies on a Catalog Item view: true
Applies on Requested Items: true
 
function onLoad() {
     g_form.setDisplay('sp_ui_policy_test', false);
}
 
The resulting behaviour is the same as the UI Policy, it works on the order something page and outside SP, but not on the [ticket] page.
 

Workaround

This is expected behaviour. The widgets on the default "ticket" page (ticket-conversation and ticket-fields) do not include or contain a Form widget, so they can not use Client Scripts or UI Policies. They are simpler widgets to only show information without benefit of those conditional scripts.
 
As a workaround, to be able to add UI Policies or Client Scripts, use or create another page that makes use of the Form widget. Then UI Policies and Client Scripts will be available.
 

Related Problem: PRB741358

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.