Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Forrest  Falk
Tera Guru

I'm Forrest Falk, a ServiceNow Certified Master Architect (CMA). This is the second post in a series where I share practical insights from a CMA’s perspective and show how to build a custom skill that suggests a category based on an incident's short description and description. In each post, we will add more to our skill, covering everything from creating it to triggering it with a UI Action on a form to automating it with a flow.

 

Check out the previous posts in the series below:

 

In this post we are going to pick up from part 3. We are going to focus on how can we get the category format in a way that we can easily process it with a script for future looking. My idea is that if we can get the output to output the label and value at the same time and separate the two with a colon. The output should be in the format <category label>:<category value>  For example, it would look something like Inquiry / Help:inquiry. The label is “Inquiry / Help” and the database value is inquiry.

If you want to get more ideas on what formats or how to do output formatting there is a great Medium article on it here: https://medium.com/@the_manoj_desai/output-formatting-strategies-getting-exactly-what-you-want-how-y... 

I want to adjust the prompt a bit to return the label and value of the category selection. In the context section I added the format that we are getting back from the getIncidentCategories tool (label:value).

ForrestFalk_0-1765560455161.png


In the output section I added how I want the skill to output both the label and value.

ForrestFalk_1-1765560455163.png

 

My whole prompt now looks like this:

ForrestFalk_2-1765560455168.png

 

When I rerun the test, I get:

ForrestFalk_3-1765560455169.png

 

Success! We have created a new skill that will output a category based on an Incident’s short description, description, and available categories. In my next post, I will walkthrough how to add the UI Action for an agent to click to the incident form. Future looking we can also trigger a flow to automatically set the category when assigned to a team or agent.

Continue to part 5 here: Coming soon!