How to add hyperlink into info message on problem table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 01:13 AM
For example, when a certain incident record is "resolved" we get an info message into the problem table
Please help any one.
Please send the script. It is very helpful for me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 01:18 AM
Hi @vinod6
You can simply add html in the message. Something like
//incident part provided as bascix example
var inc = new GlideRecord('incident');
inc.insert();
var url = '<a href="./incident.do?sys_id=' + inc.sys_id + '>' + inc.number + '</a>';
gs.addInfoMessage('Incident ' + url ' + ' has been created.');
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 01:31 AM
Hi @vinod6
Can you elaborate the requirement?
Are you trying to display an info message if an Incident that belongs to that particular problem is resolved? If yes try the below Display Business Rule.
(function executeRule(current, previous /*null when async*/ ) {
var incGr = new GlideRecord("incident");
incGr.addEncodedQuery("problem_id=" + current.getUniqueValue() + "^state=6");
incGr.query();
while (incGr._next()) {
var link = '<a href="' + incGr.getLink() + '">' + incGr.getValue('number') + '</a>';
var message = gs.getMessage('Incident Resolved') + ' ' + link + ' ';
gs.addInfoMessage(message);
}
})(current, previous);
If you want to display Closed incidents also, try below code.
(function executeRule(current, previous /*null when async*/ ) {
var incGr = new GlideRecord("incident");
incGr.addEncodedQuery("problem_id=" + current.getUniqueValue() + "^stateIN6,7");
incGr.query();
while (incGr._next()) {
var link = '<a href="' + incGr.getLink() + '">' + incGr.getValue('number') + '</a>';
var message = gs.getMessage('Incident Resolved') + ' ' + link + ' ';
gs.addInfoMessage(message);
}
})(current, previous);
Please mark my answer helpful and accept as a solution if it helped 👍✔️
Anvesh