- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Creating Declarative Actions that open a dialog used to be a rather complicated process in ServiceNow. Fortunately, with the Australia Release, ServiceNow introduced UI Interactions, a feature that solves this issue.
I previously shared my initial experiences exploring UI Interactions. In this article, I want to walk you through some concrete, highly practical use case: using a custom Now Assist Skill in a UI Interaction to evaluate and improve Incident resolution notes.
If you want to ensure your agents are providing high-quality, contextually accurate resolution notes that meet professional standards, this approach is for you. (Note: I have previously implemented something similar using Playbooks. If you prefer the Playbook route, you can find that guide here).
The idea is simple but powerful. Large Language Models (LLMs) are excellent at determining whether a provided text meets a specific standard.
If an agent tries to close an incident by simply typing, "I fixed it," our custom Now Assist Skill will step in and respond with something like:
The resolution note 'I fixed it' is completely insufficient. It provides no information about what was done to resolve the issue. A proper resolution note should detail the steps taken, the root cause if identified, and any actions the user might need to take. This helps with future troubleshooting, knowledge management, and provides a clear record of the work performed.
By feeding the Skill the incident's Short Description, Description, and Work Notes, the Skill can evaluate whether the proposed resolution actually makes sense for that specific issue. If the resolution is good, the Skill can take it a step further by polishing the grammar, fixing typos, and making it sound more professional.
Here is how to build it.
Create the Now Assist Skill
First, we need to open Now Assist Skill Kit and create a new skill.
We create inputs for the short description, description, work notes and resolution notes.
Now what’s left is the prompt we use in the skill.
## ROLE
You are a very experienced Service Desk agent, with excellent technical skills and excellent communication skills, your task is to decide whether the resolution notes provided make sense given the content of the incident.
In addition to this, if the solution sounds like a possible solution but the grammar or the wording sounds not like from a native English speaker provide a proposal like a native speaker would formulate it.
## CONTEXT
The given resolution note is:
{{resolution_note}}
Here is the information about the incident
Short Description: {{short_description}}
Description: {{description}}
Work notes: {{work_notes}}
## OUTPUT FORMAT
The response must strictly adhere to the following JSON schema:
{"reasonable": true|false,
"reason": <the reason why you think it is not a reasonable solution, empty if solution is reasonable>,
"improved": <improved version of the resolution notes if the solution is reasonable, otherwise it is empty>
}
To make the skill available in UI Builder, we need to deploy it for UI Builder.
On the Skill settings tab, under Deployment settings, activate UI Builder.
The skill is now deployed, but before we can use it we also need to activate it. This can be done under:
Now Assist Admin > Skills
Implement the UI Interaction
UI Interactions are built inside UI Builder (UIB).
When creating the new UI Interaction, I select Form as the type, since I want this to appear directly on the Incident form. This selection grants us access to specific form data and tools.
UI Interactions can be triggered by a Declarative Action or directly from an event in UIB. For this use-case we want to launch it using a Declarative Action.
We need to think of how to pass the context of the incident into the UI Interaction so that we can hand it to the Now Assist Skill we created.
When creating a Declarative Action with Form as the action model we have access to certain data.
We could use “fields”. This provides not only the value of the fields but also a lot of meta data. But then the fields we need have to be visible on the form. This may not always be the case.
Therefore, I decided to use Table and SysId. We then need to first use a Server Script Step to query the record to get the context of the Incident.
Server Script Step
Within the UI Interaction flow, add a Server Script step. This allows us to execute a server-side script with access to all the server-side APIs we are used to. A simple GlideRecord query can fetch the exact context we need.
Input variables for the script can be bound to input variables of the UI Interaction or to output variables from other steps.
A Server script step returns a success or an error event. In this case we need to return additional information like the short description and the description of the incident. This can be done by just returning an object with the needed information as attributes.
If the script breaks or you throw an error intentionally, the error event will be returned, and you can handle it accordingly to your requirements in the UI Interaction flow.
Now we have the information we need to pass it all into a modeless dialog where we call the Now Assist Skill, we created.
Modeless dialog with custom Now Assist Skill
Next, we add a Modeless Dialog to our UI Interaction flow to interact with the agent. This dialog is a custom component created using the Component Builder.
The final dialog should look like in the picture above. A text area where the agent enters the resolution notes, underneath is space for an improved version provided by the skill or a reason why the resolution notes are not acceptable.
We have a button to check the resolution notes, one to post the resolution to the form and one to just close the dialog.
Here are the steps we need to do in the Component Builder to create the dialog.
- Define component properties to receive the data from the server script.
- Add the UI elements. Include a text area (for the agent's input), a stylized text (to display feedback from the skill), and buttons (Check, Post, Close).
- Add the Now Assist Skill
- Create an event that the dialog dispatches to return the resolution notes to the UI Interaction flow.
- Wire everything together.
- Resolution notes entered in the text area are stored in a client state variable.
- “Check” button executes the Now Assist Skill using the entered resolution notes and the components properties
- “Post” button clicked will dispatch the event we created and close the dialog.
- “Close” button clicked will close the dialog.
- Now Assist Skill execution completed will trigger a client script to parse the result from the skill.
Back in the UI Interaction flow we need to fill the dialogs properties with the values from the server script step.
When mapping the Server Script results into the dialog's properties within the UI Interaction flow, the UI only show the top-level results variable. You can manually drill into your object by double-clicking the pill and appending your keys, like this:
@step1_success.result.description
Set Field Value Step
Finally, we need to capture the resolution notes when the user clicks "Post" and write it to the incident form.
The Modeless Dialog will dispatch two events:
- Modeless dialog closed
- RESOLUTION_NOTES_QS#SET_NOTES
We only need to add the latter to the UI Interaction flow and use a Set field value step to map the payload from that event to the resolution notes field on the incident form.
And that is it! Your agents now have a seamless, AI-powered assistant directly on the Incident form to help them write flawless resolution notes.
Keep in mind, this is just a proof of concept. You can use this architecture as a baseline and scale it into a fully production-ready solution tailored to your organization's specific requirements.
Happy building!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
