-
Notifications
You must be signed in to change notification settings - Fork 909
Normalize "prod" Environment Values Using GlideFilter for Case-Insensitive Matching #2039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize "prod" Environment Values Using GlideFilter for Case-Insensitive Matching #2039
Conversation
If you need HTML beautified alert box, use this.
UI Page to render the custom alert
These are example ScreenShots for reference
Example Screenshots
…Info.png to Catalog Client Script/CustomAlert/Screenshots/ExampleScreenShotCustomAlertInfo.png
…ertSuccess.png to Catalog Client Script/CustomAlert/Screenshots/ExampleScreenShotForCustomAlertSuccess.png
…rtDanger.png to Catalog Client Script/CustomAlert/Screenshots/ExampleScrenShotForCustomAlertDanger.png
Notes for installation or Implementation
Business rule to add work notes on record if notes for tag entries are allowed. It is very hard to track who added the tag to the record and when, this will help to manage to understand who has added what tags on record.
Business rule to add work notes on record if notes for tag removal are allowed. It is very hard to track who removed the tag to the record and when, this will help to manage to understand who has removed what tags on record.
Notes for the implementation
This reverts commit a56fd1f.
This reverts commit deb75b1.
This reverts commit 064f919.
…tion Using getError() and setError() directory
|
Hi @bird-03 |
|
Thanks for your contribution! we truly appriciate your effort & intent to participate. Though your contribution looks good and correct with right use of GlideFilter API to update the environment field, It appears that this pull request seems to be copied from a community answer or mostly AI generated code without proper attribution. Contributions should be original, and any referenced work should be properly attributed. Would you mind updating the script with more creative use case submission and update this script & PR with quality contribution. We will be Happy to merge and accept your contribution Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one. |
|
@bird-03 |
PR Description:
Summary
This fix script normalizes all case variants of the
u_environmentfield on thechange_requesttable, converting values likeprod,PROD,PrOd, etc., into a consistent"Prod"value.Key Improvements
GlideFilterAPI withsetCaseSensitive(false)to perform case-insensitive matching, improving code readability and maintainability.setEnforceSecurity(true)ensuring secure data access.ifconditions by leveraging declarative filter logic consistent with platform UI filtering.How It Works
The script queries all change requests where
u_environmentis not null, applies the GlideFilter with a case-insensitive condition (u_environment=prod), and updates any non-standard casing to"Prod". Informative logs are output for traceability.Benefits
This PR helps improve data hygiene and sets a pattern for future case-insensitive normalization tasks using GlideFilter.
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions