Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

When change request closed then related problem ticket should close automatically.

User712413
Tera Contributor

I used below script but it is throwing errors. could you please make it correct.

User712413_0-1722960975599.png

 

 

// Business Rule: Close associated problem when change request is closed
// Table: Change Request [change_request]
// Condition : State changes to Closed
// When: After update

            var problemGR = new GlideRecord('problem');
            if (problemGR.get(current.sys_id)) {
                problem.state = 3; // Set problem state to "Closed"
                problem.update();
            }
1 REPLY 1

Neeraj31
Mega Sage

Hello, 

 

Inside if condition you have used "problem" variable instead of "problemGR". Please replace it and try.

 

Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!