how to identify any sysid in script include table using instance scan

String
Kilo Sage

Hi all,

Am new to instance scan ,Please guide me how to check sysid (any hard coded sys id ) in script include ,And will run instance scan ,so it will identify the bad practice of writing sysid in script include 

14 REPLIES 14

Hi ,

Please check the below screenshots and please guide me find_real_file.png

find_real_file.png

find_real_file.png

Have you got a Script Include which should have been found as issue? Please share an example.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 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

Hi ,

My script include(hard coded sysID) is not found

Please check the below image 

find_real_file.png

 

Not sure yet, copied your code, tested against my check, works instantly.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 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

SaschaWildgrube
ServiceNow Employee
ServiceNow Employee

The CodeSanity app contains a set of Instance Scan checks aimed at improving source code and application quality. Developers should run them before shipping a new application version.

Checking for hard-coded sys_ids in scripts is one of them.

Indeed, scripts in flow actions are not yet covered. I believe this is a platform deficiency which should be resolved rather sooner than later!

Vote to make it part of the platform OOTB!

https://community.servicenow.com/community?id=view_idea&sysparm_idea_id=23716958db25d514904fa9fb1396...

Or install it right away:

https://www.wildgrube.com/servicenow-codesanity