what code to replace gs.setProperty()

IceIronDragon
Tera Guru

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));

1 ACCEPTED SOLUTION

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 ?

View solution in original post

9 REPLIES 9

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 

thank you

I will test it. thank you 

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn

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