
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 06:21 PM
Hi All,
I am working on a code which does not fit well with our best practices (gs.setProperty()) and I was hoping if someone can guide me what code to write in place of the exiting code :
this.debug(JSON.stringify(statusList));
gs.setProperty('sn_vul.synack.vulnerability_statuses', JSON.stringify(statusList));
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 06:52 PM
thank you ,
I am not that good with JS, just to understand I already have a property which store the status value, would not that do it for eg 😕
this.debug(JSON.stringify(gs.getProperty('sn_vul.synack.vulnerability_statuses')));
or do I create another property to store JSON value ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 06:56 PM
If you have it already then it would do the work instead of set property in your question that you posted just use get property thats it
this.debug(JSON.stringify(gs.getProperty('sn_vul.synack.vulnerability_statuses')))
Hope it helps:)
Mark my answer correct if it helped you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 06:56 AM
thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 06:58 AM
I will test it. thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 09:42 PM
Hi there,
Can you explain your question a bit more? Is it about a best practice to not use gs.setProperty regarding cache flush? Or is your question different?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 06:57 AM
yes, we have a third party best practice plugin which suggest to replace gs.setProperty not to be sued, so i am looking for a replacement in the code mentioned above