Converting a URL into hyperlink in Work Notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 10:37 AM
Hello,
I have a requirement where I want to convert a URL that is added into Work Notes of an incident into Hyperlink. The users who will be adding these links will not have the capability to add HTML tags to the link before submitting.
I have created a business rule before insert update and condition when work notes changes. Below is the script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
var linkTemplate = '[code]<a href="$1" target="_blank">$1</a>[/code]';
current.work_notes = current.work_notes.replace(exp, linkTemplate);
})(current, previous);
This code is working, however it shows like this below after clicking on Submit in Work Notes.
I would just want the Hyperlink but not the URL text.
Any insights on what the issue could be in the script would be great. I got this script from one of the community questions on a similar issue but do not have a solution for this.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 07:36 AM
even after doing that it does not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2022 05:21 AM
Is this attribute working for you?
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2022 05:26 AM
@Sebas Di Loreto I tried the same but it is not working for me as well. I read it somewhere this is the way it can be used for putting the URL's@ in a field but I had no luck on this.
@Kamy Please ignore the first solution provided.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 02:54 AM
Hi Kamy,
Can you let us know whether you found fix? We have similar kind of requirement and couldn't able to remove text URL.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 07:41 AM
Hi Kamy,
Can you let us know whether you found fix? We have similar kind of requirement and couldn't able to remove text URL.
Thank you!