How to handle hardcoded email IDs in scripts when dev and prod use different addresses?

Vijay Kumar4
Mega Guru

I have created an inbound action with an email-based condition in the script. However, since I’m using a different email in production, I’m wondering—what’s the best practice here? Should I update the script with the production email after testing in dev, just before deployment?

VijayKumar4_0-1744379817209.png

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Kumar4 

store that in system property and then use gs.getProperty('property_name') to get the value and use in script

It's good for maintenance and no script change required, only property change and you are good

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Kumar4 

store that in system property and then use gs.getProperty('property_name') to get the value and use in script

It's good for maintenance and no script change required, only property change and you are good

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Ankur Bawiskar So after deployment to production, do I need to manually update the system property value?

@Vijay Kumar4 

That's correct, you can add that as manual activity after deployment of update set.

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thanks @Ankur Bawiskar