Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

system property for instance email address?

scwillson
Mega Guru

Is there some kind of hidden system property that holds a given instance's email address?

More than once, I have encountered situations that would have been easier if I didn't have to hard code the instance's email address.

I can certainly just build a little script include that would be able to pull it, but before I start, I figured I'd see if anyone knows of a way to pull the instance email address other than just querying the sys_email_account table.

To explain further, when building customization that are traveling from a Dev. instance   through a Test instance, and eventually into Prod. It doesn't seem like modifying the hard coded instance email address is the best approach. So I want a way to hard code an 'instance email address pull'.

Much like how "gs.getProperty('glide.servlet.uri')" pulls the URI

1 ACCEPTED SOLUTION

Matthew Glenn
Kilo Sage

Not 100% sure about grabbing the exact email address, but you could do something like this:



var email = gs.getProperty('instance_name') + '@service-now.com';


View solution in original post

2 REPLIES 2

Matthew Glenn
Kilo Sage

Not 100% sure about grabbing the exact email address, but you could do something like this:



var email = gs.getProperty('instance_name') + '@service-now.com';


Ha. Brilliant. Thanks Matthew.



I can't believe I've gone this long without knowing that 'instance_name' is an available property.