hyperlink popup message containing a link

Anubhav Srivas1
Tera Expert

Hello Experts, I need to hyperlink a popup message containing a link, please help! here is my script: function onChange(control, oldValue, newValue, isLoading) { if(g_form.getValue('application_available_in_teams_app_store') == 'no'){ alert('If app not available in Teams App store , Please raise JIRA front door request using this link - https://jira.secure/CreateIssueDetails!init.jspapid=33820&issuetype=39&summary=Workforce%20Front%20D...'); } }

8 REPLIES 8

Nayan  Dhamane
Kilo Sage
Kilo Sage

Hello @Anubhav Srivas1 ,

Please use below script:

var urlString = '<p><a class="web" target="_blank" href="' + "Put your link here" + '">' + "Click Here" + '</a></p>';

	g_form.alert('Your Incident is already escalated  If you want to know more ,please click' + urlString);
If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Hi, I tried your solution but it doesn't work and shows an error: there is a javascript error in your java console.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === 'yes') {
return;
}

var urlString = '<p><a class="web" target="_blank" href="' + "https://jira.service.anz/secure/CreateIssueDetails!init.jspapid=33820&issuetype=39&summary=Workforce..." + '">' + "Click Here" + '</a></p>';

g_form.alert('Your Incident is already escalated If you want to know more ,please click' + urlString);
}

 

Tony Chatfield1
Kilo Patron

Hi, your post does not make your issue\problem clear, what is the issue you are encountering and what are the details of your diagnostics\fault finding?

Hayo Lubbers
Kilo Sage

Hi @Anubhav Srivas1 ,

 

Can you try the same with a confirm? Instead of clicking the link, the OK button would navigate you to the desired location.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
	if (isLoading || newValue === '') {
		return;
	}

	var url = 'https://www.google.com';
	if (confirm('If app not available in Teams App store , Please raise JIRA front door request using this link - ' + url)) {
		g_navigation.openPopup(url);
	}

}