system properties for URL in notifications

snowuser111
Kilo Guru

HI ,

Is there a way I can use system properties for links in Notification body. We do not want to use the hard coded links as these might change time to time.

Please let me know if it can be done.

I have notifications with email scripts which is displaying the links but need to know if we can use system property or any dynamic solutions.

Thanks,

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,



you can create system properties


Go to sys_properties.LIST and create a new property


User email notification script where you can do server side coding.


In mail script you can do var propertyValue = gs.getProperty('nameOfProperty');


template.print('<p>'+propertyValue+'</p>');



Use this newly created notification script in email notification body as ${mail_script: mailScriptName}



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

sachin_namjoshi
Kilo Patron
Kilo Patron

You can use getProperty method in your mail script.



http://wiki.servicenow.com/index.php?title=GlideSystem#getProperty.28String.2C_Object.29



Regards,


Sachin


SanjivMeher
Kilo Patron
Kilo Patron

You can create a property record in sys_prperties table.


And in server side scripts use gs.getProperty('my_server_link') to get the link.



Please mark this response as correct or helpful if it assisted you with your question.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,



you can create system properties


Go to sys_properties.LIST and create a new property


User email notification script where you can do server side coding.


In mail script you can do var propertyValue = gs.getProperty('nameOfProperty');


template.print('<p>'+propertyValue+'</p>');



Use this newly created notification script in email notification body as ${mail_script: mailScriptName}



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

 

Similar way can we add company logo in system property to use in notification, If yes how to do that.

 

Thanks,

Ravi