Use case: Summarize a client script using Now Assist
Summarize
Summary of Use case: Summarize a client script using Now Assist
This feature enables developers to quickly understand and edit client scripts within UI Builder experiences by leveraging Now Assist's AI-powered summarization. It addresses the challenge of lengthy, undocumented client scripts by providing instant, detailed explanations of script logic and trigger events. This capability is especially valuable for teams maintaining existing IT operations portals where original script authors may no longer be available.
Show less
Key Features
- AI-generated script summaries: Select any client script in the Data and scripts panel to receive both a high-level summary and a detailed breakdown of its functionality and trigger conditions.
- Explain Code panel: Automatically appears for users with the
uibuilderadminrole when the Client script summarization skill is enabled, facilitating quick access to script explanations. - Real-time updates: After editing a client script, developers can regenerate the summary to reflect changes and ensure understanding of the latest code version.
How to Use
- Ensure UI generation is installed and assign the
uibuilderadminrole to users. - Navigate to All > Now Experience Framework > UI Builder and open the relevant portal experience.
- Select the page containing the client script and open the script in the Data and scripts panel.
- Use the Explain Code panel to request a summary and detailed explanation.
- After making any script changes, select Explain again to update the summary.
Benefits for ServiceNow Customers
This feature significantly reduces the time required to understand complex or undocumented client scripts, enabling developers to confidently plan and implement updates. It minimizes the risk of introducing bugs or breaking functionality by providing clear insight into script behavior and triggers. Overall, it accelerates development cycles and helps maintain the integrity of IT operations portals.
Understand and edit client scripts.
Scenario
A developer at a financial services company has joined a team responsible for managing an existing IT operations portal created with UI Builder. This portal consists of multiple pages that contain client scripts written by a previous developer who is no longer with the organization. Before making any modifications, the new developer needs to understand the functionality of each client script and the specific events that trigger them.
Problem
The client scripts are lengthy and undocumented, making it time-consuming for the developer to read through each one to understand its purpose. Misinterpreting a script before making changes could introduce bugs or break key portal functionality. Manually reviewing and documenting each script would take hours and slow down the team’s ability to deliver updates.
Solution
With Client script summarization, the developer can select any client script in the Data and scripts panel and request an instant AI-generated explanation. Now Assist provides both a high-level summary and a detailed breakdown of the script’s logic and trigger conditions, enabling the developer to quickly assess the script’s purpose and decide whether changes are safe to make.
Before you begin
Make sure that you install UI generation and that you have the ui_builder_admin role. For more information, see Install UI generation and Grant UI Builder admin role.
Configuration steps
- Navigate to .
- Open the IT operations portal experience.
- Select the page that includes the client script for review.
- In the Data and scripts panel, open the relevant client script.The Explain Code panel appears.Note:The Explain Code panel appears only if you're assigned the ui_builder_admin role and if the Client script summarization skill is enabled.
- Select Explain this code.
- Review the concise summary and detailed explanation, including trigger conditions.
- If you make changes to the script, select Explain again to regenerate the summary for the updated version.Note:If you update a script after reviewing the explanation, the Explain Code panel will notify you of the code changes. Always select Explain again to understand the latest version of the script.
Outcome
The developer quickly comprehends the purpose and functionality of the client scripts, whereas manually reading and interpreting the code would take several hours. This knowledge enables the developer to confidently plan and implement updates without the risk of introducing unintended regressions.