You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 🔄 ServiceNow Fix Script: Normalize "prod" Environment Using GlideFilter
2
+
3
+
## 📌 Problem Statement
4
+
5
+
In many ServiceNow environments, custom fields like `u_environment` on tables such as `change_request` often contain inconsistent variants of the same logical value, for example:
6
+
7
+
-`prod`
8
+
-`PROD`
9
+
-`Prod`
10
+
-`PrOd`
11
+
-`pRoD`
12
+
13
+
These inconsistencies cause:
14
+
- Confusion in reports
15
+
- Broken automation rules
16
+
- Poor data hygiene
17
+
18
+
This script identifies and normalizes all case-variant values of `"prod"` to a consistent format: `"Prod"`.
19
+
20
+
---
21
+
22
+
## 🚀 Solution: Fix Script Using GlideFilter
23
+
24
+
We use **`GlideFilter`** with **case-sensitive matching** to cleanly and securely identify inconsistent values. This avoids multiple `if` conditions or regular expressions.
25
+
26
+
---
27
+
28
+
## ✅ Practical Example
29
+
30
+
Instead of writing custom logic like this:
31
+
32
+
```javascript
33
+
var env =gr.u_environment.toString().toLowerCase();
0 commit comments