Forrest  Falk
Tera Guru

I'm Forrest Falk, a ServiceNow Certified Master Architect (CMA). This is a post in a series where I share practical insights from a CMA’s perspective and show how to build a custom skill that you can trigger with a UI Action. If you want to view the previous post in this series or the series on how to create the skill itself, please check out the links below. Feel free to comment below with any questions or suggestions.

 

Previous post in this series:
How to Trigger a Custom Now Assist Skill via UI Action - Part 2

Previous series creating a custom Now Assist Skill:
Creating a Custom Skill with Now Assist Skill Kit - Part 1

 

In our previous post, we successfully got our skill to trigger via UI Action. However, it is not very readable, let’s fix that real quick. Go back to your “Set Incident Category” UI Action.

Around line 19 you should see this:

ForrestFalk_0-1766089717475.png

What is happening is that we are returning the entire JSON object instead of just the value of the model_output variable. To just return the value, we are going to parse the JSON object and then call the model_output variable from the JSON.  In my example, I commented out the old info message line and added the new lines below. Yours should look something like this:

ForrestFalk_1-1766089717478.png

 

Go ahead and save the UI Action and let’s try to run our UI Action on our test incident. Now when we run it, we get a result similar to:

ForrestFalk_2-1766089717486.png

 

Success! We now have a custom skill that can tell us what the category should be within seconds. You could parse out just the label if you just want to show the label to the end user. You could do this by adding an additional split on colon ":" to your code.

Now what would be even better is if this could be triggered automatically to set the category and save our human agent a click. In the next part of our series, we will work on how we can automate our skill.