Insert URL link in an Incident

rless
Kilo Contributor

Is there a way to insert a hotlink in an incident?   We want the ability to insert a URL link either in the short description or additional comments section and have the link open in a new tab.   Any feedback much appreciated!

19 REPLIES 19

Hi Vanessa,



As a workaround until ServiceNow implements the enhancement request, you could create an OnLoad Client Script with the following code as a starting point. Just replace the console.log line with the code you want to execute on click of the Post button. Keep in mind this code is dependent on the Post button DOM element class, so if that changes in future updates it could potentially break this.



function onLoad() {


    //Type appropriate comment here, and begin script below


    $j(document).ready(function() {


      if (typeof($j("button.activity-submit")[0]) != undefined) {


    $j("button.activity-submit").bind('click', function () {


            console.log('Post button was clicked!');


    });


      }


    });


}


Oh Michael, just tried this on my Dev instance and it worked a treat! Thanks so much.


Will discuss the possible drawbacks of implementing it with my client (possible future "breakage" etc) and see what he says.   But at least I have a solution to offer.


Thanks again, Vanessa


ali25
Kilo Contributor

Hey this does not work anymore, has anyone found an alternative solution?


We began using this type of functionality but found an issue with the "Post" button. If a user added a comment or worknote using the "Post" feature and then clicks Save or Update, the journal entry gets duplicated.



Does anyone know of a method to get around this?


rless
Kilo Contributor

Our team has decided the best solution at this time is to implement a URL field on forms.   This was the simplest solution to implement for our needs at this time.   Thanks for all the replies!