Script Manager Naming Rules
When creating Groovy scripts and folders in Script Manager, you must follow specific naming rules to ensure your scripts function correctly. These rules are enforced by the frontend validation system. As you type the name, spaces are automatically replaced with underscores, and invalid characters are rejected. If a character is rejected, an explanatory notification appears in the top-right corner of your screen.
Script names
| Category | Rules | Examples |
|---|---|---|
| Start with: A letter only (a-z, A-Z) Use anywhere: Letters, numbers, underscores, and hyphens Maximum length: 248 characters (the |
|
|
|
|
Folder names
| Category | Rules | Examples |
|---|---|---|
| Start with: A letter only (a-z, A-Z) Use anywhere: Letters, numbers, underscores, hyphens, and forward slashes (for nested folders) Maximum folder name length: 255 characters. Each folder in a path cannot exceed 255 characters. Maximum path length: 600 characters (includes all parent folder names + folder name), as long as each stays within the individual folder name limit. |
|
|
|
|
Total path length validation
The total path length (including all parent folders and the script folder name) must not exceed 600 characters. This applies to both script files and folders.
Example
If you have a folder path: very/long/path/structure/that/goes/deep/into/the/hierarchy
And you try to create a script file: anotherVeryLongFileNameThatWouldMakeTheTotalPathExceed600Characters.groovy
The validation will fail if the combined length exceeds 600 characters.
Auto-fixing behavior
Script Manager automatically fixes some common issues as you type:
- Spaces: Automatically replaced with underscores (
_). - Invalid starting characters: Automatically removed (e.g., typing
123testbecomestest). - Invalid characters: Automatically removed (e.g., typing
test@scriptbecomestestscript). - Slashes in file names: Automatically removed.
- File names exceeding 248 characters: Automatically truncated.
When these auto-fixes occur, you'll see confirmation messages.
Duplicate name detection
Script Manager prevents you from creating scripts or folders with the same name in the same location. The comparison is case-insensitive, so MyScript and myscript are considered duplicates.
Best practices
- Use descriptive names: Choose names that clearly indicate the script's purpose.
- Use camelCase or kebab-case:
myScriptormy-scriptare both valid. - Avoid special characters: Stick to letters, numbers, underscores, and hyphens.
- Keep names concise: While you can use up to 248 characters, shorter names are easier to work with.
- Organize with folders: Use nested folders to organize related scripts (e.g.,
utils/helpers,workflows/validators).
Technical notes
- File names automatically get the
.groovyextension appended. - Folder structures should be reflected in the package definition of scripts and classes.
- Validation happens in real-time as you type.
- The validation rules are enforced on the frontend before saving to the backend.
- These rules ensure compatibility with Groovy file system conventions.