Problem tickets cannot be created from within an incident context menu

nameisnani
Mega Sage

Hi Team ,

 

can anyone please help me on this issue .

 

From within an incident - Create Problem does not working - Refer attached

 

nameisnani_0-1750920666985.png

 

 

why this is happening , could anyone please help me on this . 

 

Thanks

1 ACCEPTED SOLUTION

@nameisnani 

you are aborting the insert/update if group is not your group sysId

When problem is created via that button from Incident at that time of insertion assignment group is empty and the IF condition will match.

Update your BR script as this so that it checks if group is not empty

(function executeRule(current, previous /*null when async*/ ) {
    // Replace 'Problem Manager Group' with the sys_id of the actual Problem Manager group
    var problemManagerGroupSysId = '19d892ee873c0d50158285d50cbb356a';

    // Check if the assignment group is not the Problem Manager Group
    if (current.assignment_group != problemManagerGroupSysId && current.assignment_group != '') {
        gs.addErrorMessage('Please note, any problem record should be assigned to Problem_Manager ONLY.');
        current.setAbortAction(true); // Prevent the record from being saved
    }
})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

20 REPLIES 20

Hi @Nishant8 

 

Even after updating, same issue. 

nameisnani_0-1750940221018.png

@Ankur Bawiskar  could you please help me here

Hello @nameisnani, Good to see that you have got the problem resolved.

My script didn't work since you didn't use the complete method rather just adjusted in your own script.

Basically, you seemed to be restricting the problem if assigned group is not Problem_Manager, and in my script I just ensured that problem is created with the same group since at the time of creation, problem assigned group remains blank.

anyways cheers!!!

 

Regards,

Nishant

The issue with your Business Rule (BR) is that it's blocking the creation of Problem records unless the assignment_group is exactly equal to the Problem Manager group. But when you create a Problem from an Incident via context menu, the assignment_group may be empty or default—not yet set—causing the BR to abort the creation.


🔍 Problem:

if (current.assignment_group != problemManagerGroupSysId)

This condition fails (and blocks creation) even when assignment_group is empty, which it likely is during initial creation.


Fix:

Allow record creation and only enforce the rule when assignment_group is not empty:

(function executeRule(current, previous) {
    var problemManagerGroupSysId = '19d892ee873c0d50158285d50cbb356a';

    // Only enforce if assignment_group is populated
    if (!gs.nil(current.assignment_group) && current.assignment_group != problemManagerGroupSysId) {
        gs.addErrorMessage('Please note, any problem record should be assigned to Problem_Manager ONLY.');
        current.setAbortAction(true);
    }
})(current, previous);

Optional: Make it a before insert/update rule on the problem table only.

 

@nameisnani Please accept my solution and give helpful if you found it useful. 

 

Thanks and regards 

Nitya Bansal

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @nameisnani 

Are you assigning the Problem (PRB) to someone who doesn't have the Problem Manager role? If so, that’s an issue. I believe there’s a Business Rule in place that enforces a condition requiring the PRB to be assigned to someone with the Problem Manager role.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************