Service Portal

SUJITHA PS1
Tera Contributor

Hi All ,

I need to make this priority as a URL of Kb article. Can someone guide me to do this. Attaching screenshot. this page coming under all activities .

SUJITHAPS1_0-1665055372673.png

 

Thanks

 

5 REPLIES 5

AnubhavRitolia
Mega Sage
Mega Sage

Hi Sujitha,

 

You can go to particular Widget from where Additional Details are displayed and there in HTML where priority is displayed, you can make that as hyperlink.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hi @AnubhavRitolia ,

There is no HTML for additional details and priority . attaching html screenshot and server script.

SUJITHAPS1_0-1665064564608.png

(function() {
	var tableName = $sp.getParameter('table');
	var sysId = $sp.getParameter('sys_id');
	var record = sn_std_tkt_api.TicketConfig.getTicketRecord(tableName, sysId); 

	data.canRead = (record != null && record.isValid() && record.canRead());
	if (!data.canRead)
		return;
	
	if ($sp.getParameter('headless') == 'true')
		data.headless = true;
	else if ($sp.getParameter('headless') == 'false')
		data.headless = false;
	else if ($sp.getParameter('headless') == null)
		data.headless = false;
	else
		return;

	var urClosedState;
	if (tableName == 'universal_request') {
		urClosedState = (record.state == '7');
		if (record.primary_task) {
			var primary_table = record.primary_task.getRefRecord().getTableName();
			record = sn_std_tkt_api.TicketConfig.getTicketRecord(primary_table, record.primary_task);
			data.canRead = record != null && record.isValid() && record.canRead();
			if (!data.canRead)
				return;	
		}	
	}
	else if (record.isValidField('universal_request') && !record.universal_request.nil())
		urClosedState = (record.universal_request.state == '7');

	data.table = record.getTableName();
	data.sys_id = record.getUniqueValue();
	
	var tabs = [];
	var config = sn_std_tkt_api.TicketConfig.getConfig(data.table, record.sys_domain);
	var isNonPrimary = ((record.isValidField('universal_request') && !record.universal_request.nil()) && (record.universal_request.primary_task != record.sys_id));
	if (!config.tabs) {
		var tab_1 = {
			name: gs.getMessage('Activity'),
			order: 0,
			widget: $sp.getWidget('widget-ticket-conversation', 
														{sys_id: data.sys_id, 
														 table:data.table,
														 btnLabel: gs.getMessage('Post'),
														 read_only: isNonPrimary || urClosedState,
														 rich_text_editor: options.rich_text_editor,
														 at_mentions: options.at_mentions
														})
		};
		tabs.push(tab_1);
		var tab_2 = {
			name: gs.getMessage('Attachments'),
			order: 1,
			widget: $sp.getWidget('std_ticket_attachments', {record_id: data.sys_id,
															record_table: data.table,
															read_only: isNonPrimary || urClosedState
															})
		};
		tabs.push(tab_2);
	}
	else {
		config.tabs.forEach(function (tabConfig) {
			var tab = {};
			tab.name = tabConfig.name;
			tab.type = tabConfig.type;
			var condition = tabConfig.visible_condition;
			if (condition) {
					if (!GlideFilter.checkRecord(record, condition))
						return;
			}
			if (tabConfig.type == 'activity') {
				tab.widget = $sp.getWidget('widget-ticket-conversation', 
																	 {sys_id: data.sys_id, 
																		table: data.table,
																		btnLabel: gs.getMessage('Post'),
																		read_only: isNonPrimary || urClosedState,
																		rich_text_editor: options.rich_text_editor,
																		at_mentions: options.at_mentions
																	 });
			}
			else if (tabConfig.type == 'attachments') {
				tab.widget = $sp.getWidget('std_ticket_attachments', {record_id: data.sys_id,
																	record_table: data.table,
																	read_only: isNonPrimary || urClosedState
																	});
			}
			else if (tabConfig.type == 'variable_editor' || tabConfig.type == 'variable_summary') {
				if (record.variables.getElements(true).length == 0)
					
					return;
				
				var widgetParam = tabConfig.widget_param;
				
				if (widgetParam)
					widgetParam = JSON.parse(widgetParam)
				else
					widgetParam = {};
				widgetParam.table = data.table;
				widgetParam.sys_id = data.sys_id;
				tab.widget = $sp.getWidget(tabConfig.widget, widgetParam);
				
			}

			else if (tabConfig.type == 'custom') {
				var widgetParam = tabConfig.widget_param;
				if (widgetParam)
					widgetParam = JSON.parse(widgetParam)
				else
					widgetParam = {};
				widgetParam.table = data.table;
				widgetParam.sys_id = data.sys_id;
				widgetParam.read_only = isNonPrimary || urClosedState;
				tab.widget = $sp.getWidget(tabConfig.widget, widgetParam);
			}
			tab.order = tabConfig.order;
			tabs.push(tab);
		});
	}
	data.tabs = tabs;
})();

Hi Sujitha,

 

Could you please mention Widget name which you are using hoping it is OOTB Widget. So it would be easy to investigate and help.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Murthy Ch
Giga Sage

Hi @SUJITHA PS1 

You can go to that particular widget by clicking on Ctrl+right > Widget editor

In html section search with priority keyword and make that as URL.

 

Thanks,
Murthy