Analyze UI action to show related Problem tickets

sattar3
Tera Contributor

Hello All,

 

I’ve added an 'Analyze' button to the Problem record form.

When clicked on that button, I want it to display all other Problem records whose short description or description contains keywords similar to those in the current Problem record.

 

Example: if the word 'Interface' appears, it should return all related Problem records with 'Interface' in their short description or description. How can I implement this functionality?"

 

@Ankur Bawiskar 

 

Thanks,

Sattar

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@sattar3 

make the UI action as client side, something like this and it will show the list of problem within UI page

GlideDialogWindow: Popup Record List 

UI Action: on problem table

Client - True

Onclick - showProblem()

Script:

function showProblem() {
    var w = new GlideDialogWindow('show_list');
    w.setTitle('Associated Problems');
    w.setPreference('table', 'problem_list');
    w.setPreference('sysparm_view', 'default');
    //Set the query for the list
    var desc = g_form.getValue('description');
    var shortDesc = g_form.getValue('short_description');
    var query = 'short_descriptionLIKE' + shortDesc + '^ORdescriptionLIKE' + desc;
    w.setPreference('sysparm_query', query);
    //Open the popup
    w.render();
}

AnkurBawiskar_0-1747028400098.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

SumanthDosapati
Mega Sage
Mega Sage

@sattar3 

That's not a good idea just with keywords because you'll end up with N number of results in most cases.

For Example your problem record has this below short description: "There are Frequent Network Disruptions Impacting Connectivity and Access to Business Applications in Building A"

 

Now imagine if we split and use keywords, you'll find 100s of problems that has the words 'are', 'in', 'and', 'to'

Almost all the records have atleast one of these words in either short desc or desc. So you'll end up with whole problem table as result.

 

So, the best approach would be using 'Similarity Solutions' under Predictive Intelligence Module.

Navigate to Predictive Intelligence > Similarity > Solution Definitions from left navigator and create a new solution definition as per your requirement.

Now you can use the SimilaritySolutionVersion API in your UI action to achieve your requirement.

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth

@sattar3 

Glad that it helped you. You can click on Accept solution aswell for multiple solutions.

 

Regards,

Sumanth