- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2023 10:53 PM
Hi All,
I am working on problem management,
I have a requirement,
Out of the Problem ticket, we need to create a change request, only a Change Request closes, the problem record should close.
Can anyone help me with this?
Thanks,
Atik
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 02:53 AM
Hi @Atik I think You are not linking the relationship between the Problem and Change in your UI action, Can you Please check and Update the Parent value of the Change request to Problem.It works.
Cheers, hope that helps /Eswar
*** Please mark as "Correct" or "Helpful" as appropriate ***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2023 11:49 PM
Hello @Atik ,
Assuming you need to close Problem automatically, when associated change get closed. so you can use below script.
// 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"
// update other fields here if you want
problem.update();
}
Kindly mark correct and helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 10:21 PM - edited 08-15-2023 10:22 PM
Hi @Chetan Mahajan ,
Actually, the requirement is slightly different,
1. On the problem form when the change request is initiated(normal/standard/emergency) by right-clicking on the problem forms banner, the New Change Request record should be shown in a related list.
2. And State of the problem form should not transit to the Root cause Analysis to Fix in progress if Change is not implemented.
Could you please help me with this?
Thanks,
Atik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 11:36 PM
@Atik ,
Create Before update BR on Problem Table
Condition : state changes to "Fix in progress"
// Check if the problem state is in "Root Cause Analysis" // you can skip this If condition as well
if (current.state == 3 /* State code for "Root Cause Analysis" */) {
// Get the associated Change Request record
var changeRequest = new GlideRecord('change_request');
if(changeRequest.get(current.change_request)){
// Check if the associated Change Request is implemented
if (changeRequest.state == '-1') { // change value as per change-> implement
// Allow the problem state to be changed
return;
} else {
// Prevent the problem state from being changed
current.setAbortAction(true);
gs.addErrorMessage("Problem could not be changed to 'Fix in progress' until the related change has been implemented.");
}
}
}
Kindly mark correct and helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 10:23 AM
It is not working. Throwing below error.