Automation Scripts at Scale: Patterns, Pitfalls, and the AI-Assisted Modernization Wave
>
Automation Scripts at Scale: Patterns, Pitfalls, and the AI-Assisted Modernization Wave
Every Maximo implementation of meaningful size runs on automation scripts. Not a few. Not a dozen. Hundreds. I have walked into organizations where the script count exceeded 2,000, spread across object launch points, action launch points, integration scripts, condition expressions, and cron task scripts. Most of them were written years ago by people who have since left. Many contain logic that no one currently on the team fully understands. And a surprising number are still running on patterns that were deprecated three MAS versions ago.
Automation scripts are the double-edged sword of Maximo customization. They are powerful, flexible, and accessible to developers who do not need to compile Java. But they are also the primary source of upgrade friction, performance degradation, and technical debt in most Maximo environments. Every MAS upgrade breaks scripts. Every new feature deprecates old patterns. And every organization that has been on Maximo for more than five years has scripts that nobody remembers writing and nobody wants to touch.
This article is about managing automation scripts at scale. It covers the patterns that work, the pitfalls that cost organizations weeks of upgrade effort, and the emerging AI-assisted modernization approach that is changing how teams approach script maintenance. If you are responsible for a Maximo environment with more than 50 automation scripts, this is for you.
The State of Automation Scripts in MAS 9.2
MAS 9.2 does not introduce a new scripting engine. Automation scripts still run on the same Nashorn JavaScript engine (with Rhino fallback) or Jython for Python scripts. What changes in 9.2 is the surrounding ecosystem.
First, the user record in Manage is gone. Any automation script that references the MAXUSER table directly, whether for lookups, validations, or data enrichment, will break on upgrade to 9.2. User management now happens entirely at the MAS Core level, and scripts that need user data must use the MAS Core APIs or the MXProfile object structure.
Second, communication templates are now the sole mechanism for triggering notifications. Scripts that previously used the old notification framework, including direct calls to sendEmail() or equivalent methods, need to be migrated to the communication template framework. This is not a simple find-and-replace. The communication template framework has a different payload structure, different error handling, and different configuration points.
Third, the MIF role-based application is now mobile-only. If you have automation scripts that interact with MIF through the desktop RBA, those scripts need to be re-evaluated. The underlying MIF functionality is still available through the API, but the desktop RBA entry point is gone.
Fourth, Manage Operator patch 9.0.27 (released alongside MAS 9.2) includes a fix for a long-standing PM-generated Work Order issue (DT458077) where duplicate reservations were created for both New and Used condition codes when a PM-generated Work Order failed to change status to APPR. If you have scripts that work around this bug, you can now remove those workarounds.
Field-Tested Patterns for Script Organization
After working with dozens of Maximo environments, I have settled on a set of organizational patterns that reduce upgrade friction and make scripts maintainable over time.
Pattern 1: One script, one responsibility. This sounds obvious, but it is the most commonly violated pattern. A single automation script should do exactly one thing: validate a field, enrich a record, call an external API, or transform data for an integration. When a script does multiple things, it becomes harder to test, harder to debug, and harder to replace when one of its responsibilities is superseded by a new MAS feature. Pattern 2: Library scripts for shared logic. If the same logic appears in more than two scripts, extract it into a library script. Maximo supports library scripts that can be imported by other scripts. Use them. A common example is date arithmetic: calculating business days, handling timezone conversions, or computing SLA deadlines. Put that logic in one place and import it everywhere.
// library_date_utils.js
var DateUtils = {
addBusinessDays: function(startDate, days) {
var current = new Date(startDate.getTime());
var added = 0;
while (added < days) {
current.setDate(current.getDate() + 1);
if (current.getDay() !== 0 && current.getDay() !== 6) {
added++;
}
}
return current;
},
isBusinessHours: function(date, startHour, endHour) {
var hour = date.getHours();
var day = date.getDay();
return day !== 0 && day !== 6 && hour >= startHour && hour < endHour;
}
};
Pattern 3: Explicit error handling with context. Every automation script should have a try-catch block that logs enough context to diagnose failures. The minimum context includes: script name, launch point, MBO name, MBO ID, and the specific operation being performed.
try {
// script logic
} catch (e) {
var ctx = {
script: "WO_VALIDATE_ASSET",
launchPoint: "WO.VALIDATE",
mbo: mbo.getName(),
mboId: mbo.getUniqueIDValue(),
operation: "validateAssetLocation"
};
service.log_error("SCRIPT_FAILURE " + JSON.stringify(ctx) + " ERROR: " + e.message);
service.error("wo", "customValidationError", null);
}
Pattern 4: Version tracking in script headers. Every script should have a header comment with the script version, last modified date, author, and a one-line description of what it does. This is not just documentation. It is the first thing an AI-assisted modernization tool like Bob reads to understand the script landscape.
/**
* WO_VALIDATE_ASSET v2.3
* Last modified: 2026-03-15 by j.smith
* Purpose: Validates that the asset on a work order matches the location's
* approved asset list. Rejects work orders with mismatched assets.
* Dependencies: library_asset_utils.js (v1.1)
* Launch point: WORKORDER.VALIDATE (Object)
*/
Pattern 5: Configuration over code. Before writing a script, ask whether the same outcome can be achieved through configuration: a domain, a crossover domain, a conditional expression, a workflow, or a communication template. Scripts are the most expensive form of customization to maintain over time. Every script you do not write is a script you will not have to fix during the next upgrade.
The AI-Assisted Modernization Approach
In June 2026, IBM and the Maximo community introduced a new approach to automation script modernization: AI-assisted analysis and optimization using IBM Bob. This is not a theoretical capability. It is a working toolchain that has been demonstrated on real Maximo automation script portfolios.
The Bob Maximo Code Optimization skill has been specifically trained on Maximo coding patterns and best practices. It follows a five-stage process:
Stage 1: Discover. Bob reads all existing automation scripts in the environment, building an understanding of the current script landscape. This includes identifying launch points, dependencies between scripts, and patterns of usage. Stage 2: Analyze. Bob reviews each script and identifies outdated, risky, or inefficient patterns. It looks for repeated code blocks, missing exception handling, logic that does not align with current Maximo standards, and scripts that duplicate functionality available through newer MAS features. It also summarizes what each script does in plain language. Stage 3: Optimize. Based on the analysis, Bob suggests cleaner and more maintainable logic. This can include simplifying code, improving readability, reducing duplicate scripts, and replacing deprecated patterns with current best practices. Bob acts as a productivity accelerator: instead of someone manually reading every script from scratch, Bob provides a first-pass recommendation that a Maximo developer or architect can review. Stage 4: Validate. This is the critical stage. In enterprise environments, you cannot just generate changes and deploy them. Validation ensures that the optimized script still follows standards, uses the right payload structure, and handles edge cases correctly. Stage 5: Update. Once recommendations are reviewed and approved, changes are written back through a governed process.
The practical impact of this approach is significant. In IBM's internal pilot with Global Real Estate, the Maximo Condition Insights Agent, running on a GPT OSS 120B model, reduced physical asset analysis time from 15-20 minutes to 15-30 seconds. Review coverage expanded from 1% to 30% across 6,000 assets. The same pattern applies to script modernization: AI-assisted analysis can review hundreds of scripts in minutes, identifying issues that would take a human weeks to find.
To use Bob for script modernization, you need to set up a project with a .bob directory and a skills folder containing the Maximo Code Optimization building block. The workflow is:
# Initialize a Bob project
bob init maximo-script-modernization
Add the Maximo Code Optimization skill
bob skill add maximo-code-optimization
Export your automation scripts from Maximo
(via the Automation Scripts application or API)
Run Bob analysis
bob run "Analyze all automation scripts in ./scripts/ and identify optimization opportunities"
Common Pitfalls That Break Scripts During Upgrades
Based on field experience across multiple MAS upgrades, here are the most common script failure modes and how to avoid them.
Pitfall 1: Direct database access. Scripts that use SQLFormat or direct JDBC connections to query the Maximo database are the number one cause of upgrade failures. The database schema changes between versions, and queries that worked on 7.6 may fail on MAS 9.x. Use MBOs, object structures, or the REST API instead. Pitfall 2: Hardcoded paths and URLs. Scripts that reference specific server paths, URLs, or hostnames will break when the environment changes. Use system properties or MAXVARS for environment-specific configuration. Pitfall 3: Undocumented implicit dependencies. A script that calls mbo.getMboSet("ASSET") implicitly depends on the ASSET relationship existing on the parent MBO. If that relationship is removed or renamed in a new version, the script fails silently. Document all implicit dependencies in the script header. Pitfall 4: Silent failures. Scripts that catch exceptions and do nothing with them are time bombs. When the script fails, there is no log entry, no error message, and no indication that something went wrong. Always log errors with enough context to diagnose the failure. Pitfall 5: Unnecessary scripts. Many organizations have scripts that duplicate functionality now available natively in MAS. For example, scripts that calculate asset health scores can often be replaced by Maximo Health. Scripts that route work orders based on location can often be replaced by workflow. Before upgrading, audit your script portfolio and identify scripts that can be retired.
Integration Scripts and the JSON Mapping Workaround
A specific pain point in Maximo integration work is IBM's JSON Mapping feature. It supports Publish Channels and Enterprise Services but explicitly does not support Invocation Channels. This means that when you need to transform data for an outbound invocation, you cannot use the declarative JSON mapping configuration. You have to write code.
Amin Chakri, an IBM Maximo Technical Expert, recently published a workaround that uses a short automation script to invoke the Maximo JSON mapper engine programmatically. The approach:
1. Instantiate ExternalJSONMapper in the script
2. Apply the mapping to the Object Structure data
3. Convert the output to bytes
4. Return it as the outbound payload
// Invoke JSON mapper programmatically for Invocation Channels
var mapper = new com.ibm.tivoli.maximo.integration.json.ExternalJSONMapper();
var osData = mbo.getMboSet("MXWODETAIL").getMbo(0);
var jsonOutput = mapper.applyMapping("WO_JSON_MAP", osData);
var bytes = jsonOutput.toString().getBytes("UTF-8");
The result: reuse of existing JSON Mapping configuration, no manual JSON construction in scripts, no custom Java development, and cleaner separation of integration logic from transformation logic. This pattern should be in every Maximo integration developer's toolkit.
Practical Implications
If you are running MAS 9.0 or 9.1 and planning to upgrade to 9.2, your automation script audit should start now. The user record removal alone will break any script that touches MAXUSER. The communication template consolidation will break scripts that use the old notification framework. And the MIF RBA change will affect scripts that interact with MIF through the desktop interface.
If you have more than 100 automation scripts, seriously evaluate the AI-assisted modernization approach. Bob can analyze your entire script portfolio in minutes and identify issues that would take a human weeks to find. The time savings are real, and the quality improvement from standardized, optimized scripts pays dividends through every subsequent upgrade.
If you are writing new automation scripts today, follow the patterns described above: one script, one responsibility; library scripts for shared logic; explicit error handling with context; version tracking in headers; and configuration over code. These patterns will make your scripts maintainable through MAS 9.2, 9.3, and beyond.
Bottom Line
Automation scripts are not going away. They are the most flexible customization mechanism in Maximo, and for many organizations, they are the glue that holds the entire implementation together. But unmanaged scripts are the single largest source of upgrade friction and technical debt in the Maximo ecosystem.
MAS 9.2 changes enough under the hood that a script audit is not optional. It is a prerequisite for upgrade. The good news is that AI-assisted modernization tools like Bob are now available to accelerate that audit from weeks to hours. The organizations that invest in script hygiene now will be the ones that upgrade smoothly. The ones that do not will be the ones posting emergency questions on the IBM Community forum at 2 AM during their upgrade window.
Sources
- IBM Bob: AI-Powered Maximo Automation Scripts Modernization: https://www.youtube.com/watch?v=bNID8QRi7Iw
- All Things Maximo - June 2026: https://www.linkedin.com/pulse/all-things-maximo-june-2026-biplab-das-choudhury-ghmrc
- IBM Manage Operator Patch 9.0.27: https://www.ibm.com/support/pages/node/7276396
- IBM MAS 9.2 Announcement: https://www.ibm.com/new/announcements/introducing-maximo-application-suite-9-2
- More by Naviam: MAS 9.2 Episode 1: https://www.youtube.com/watch?v=K99fytkRa3Y