Notifications

1242 views

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

Seen In

Jakarta Patch 4

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-11-29 11:27:43
Published:2018-05-22