Reporting on catalog views

Blair5
Tera Guru

I want to take the sp_log table a step further and include catalog views the 'IT' view of service now. Is there any table out of box that has view transactions on catalog items on the 'IT' view? 

 

I created an indicator on the transaction table and can get the overall view counts for catalog items based on the URL. However, I can't figure out how to break that down by catalog item. I'm losing something in the mapping script. Any ideas? Script is on the transaction log table. 

 

function getCatItem(){

	var syslog = new GlideRecord('syslog_transaction');
	syslog.addEncodedQuery('<encoded query>');
	syslog.query();

	while (syslog.next()){
		var cat = new GlideRecord('sc_cat_item');
		cat.addQuery('active', true);
		cat.query();

		if (cat.next()) {
			if(current.url.indexOf(cat.sys_id)>-1){
				return cat.sys_id;
			}
		}
	}
	gs.log('cat: ' +cat.sys_id);
}
getCatItem();

 

0 REPLIES 0