Application and Business Service aliases or meta data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2016 09:08 AM
I've been trying for a while to figure out a good way to make it easier for users to select the correct application or business service on tasks. When you have a couple hundred or more applications and business services, a user should not have to read through all the descriptions to find the right one. I tried this solution for a while and it was ok but I was not quite satisfied because it required creation of an extra configuration item record for each alias. Plus you would have to add a client script on forms to process/change the value after the user selects the alias. I know knowledge articles and catalog items have a meta field that is somewhat integrated into searches. So one option would be to have another field on the table with the aliases and add it to the columns shown and searched in the auto-complete. But this requires the additional data to be visible to the user, which is not always desirable.
So my idea is to add a meta string field to cmdb_ci (I called the column u_meta but you can call it whatever you prefer as long as you use your name in the script) and populate it with additional keywords, acronyms or aliases related to the application or service. Then I add a before query business rule that includes the meta field in the auto-complete search:
Business rule
Table: Configuration Item[cmdb_ci]
Advanced: true
When: before
Query: true
Filter Conditions: leave empty
Script:
(function executeRule(current, previous /*null when async*/) {
//For autocomplete, where more than 3 characters entered
//add condition to check u_meta for synonyms, aliases, acronyms, etc.
//Does not apply for lookup lists
var q = current.getEncodedQuery();
var sub = 'nameSTARTSWITH'; //Substring we are looking for in query
var pos = q.indexOf(sub); //Find substring position
if(pos != -1) {
var qu = q.slice(pos + sub.length); //Get everything after sub
qu = qu.split('^')[0]; //And before any additional conditions
if(qu.length < 3) {
return; //skip for queries of less than 3 letters to filter out noise
}
q = q.replace('nameSTARTSWITH','u_metaCONTAINS'); //Construct conditions for meta search
var ans;
try {
var b = RP.isPopup();
ans = 'list_popup'; //list popup
//gs.addInfoMessage('url:' + RP.getReferringURL());
} catch(e) {
ans = 'autocomplete'; //autocomplete
current.addEncodedQuery('^NQ' + q); //Add u_meta component into the equation
}
//gs.addInfoMessage(ans + ' ' + current.getEncodedQuery());
}
})(current, previous);
A simple example: when a user is setting the Configuration Item on a form, they type in 'fis' and the auto-complete includes one named 'Financial Information System' or same for 'vpn' and 'Virtual Private Networking'. Before, we might have them named 'FIS (Financial Information System)' or 'VPN (Virtual Private Networking)' to appease the auto-complete STARTSWITH query. But then if a user typed in 'Financial' or 'Virtual', the auto-complete missed them. Or if a user types in 'antivirus', 'anti-virus' or 'security', maybe 'Trend Micro' should show up in the auto-complete results even if these terms aren't in the name.
In the first part of the script, it checks the current query to make sure it is one we want to alter. If it does not contain the appropriate substring, we can leave the query alone. Next, I added a condition so that the query does not get altered unless three or more characters have been entered. If we were to alter the query for records only based on one or two characters, it would add noise and make the search results less useful. Three seems like a good number for us as we have several three letter acronyms. Then, the new query conditions are crafted to include our meta field. The try-catch block determines whether the query is coming from the auto-complete or from a list such as the magnifying glass popup list. If it is the auto-complete, we apply the modified query which includes the meta keywords.
This is a very customizable approach. You determine when you want the alteration applied, or ignored based on the given query, number of characters entered, whether the source is auto-complete or lookup list, or you could remove these conditions if you don't find them necessary. I'm sure there are other conditions that could be applied based on how you want it to work as well. Having it in a before query business rule also makes it apply to all auto-completers, not just one on a specific catalog item or other form, so it should be easier to maintain.
I am realizing this method could potentially be applied in many situations, not just for application/service configuration items. Departments, Locations, custom tables, anything. Acronyms or aliases are fairly common and there may be other keywords users try to find them by. Though you may want to be cautious about any possible performance impact. That is partly why I added conditions on when the query should be altered or ignored.
I know a STARTSWITH query is more efficient than CONTAINS, but people need more effective searches. Telling everyone to use an asterisk to get a CONTAINS search or to pull up the lookup list and mess with filters is not super practical. And if they can't find what they are looking for, they will either perform more searches causing additional load, give up in frustration or come running to the admin and complain about it. Google doesn't require you to type in an asterisk but it doesn't just return STARTSWITH results. That is what people expect. And we shouldn't have to create a separate record for each alias and add a script to every field we want to allow aliases. We should be able to add keywords, synonyms, acronyms, etc. directly to the existing configuration item, department, location, etc. I read about a feature in the Istanbul release called Synonyms that may also be useful, but as that is not available yet we must improvise. If anyone has any thoughts or feedback, I'd appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 10:51 AM
Mike,
Did you ever try the Synonyms since it was release?
Eric