Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

based on Assignment group in incident ,related problem Assignment group must be auto populated

sasidhar3
Kilo Contributor

Hi,

Problems are to be assigned to the appropriate resolver groups based on the associated incident record ,

Based on Assignment group in incident ,related problem Assignment group must be auto populated means when we select an assignment group in incident , and when we relate any problem to that incident then the assignment group in problem must be auto populated as the same which we selected in incident .

How to do this could you please help me in this

Thanks in advance

1 ACCEPTED SOLUTION

Hi sasidhar,



Alternatively you can go with the below Business rule also. Let's take the scenario where the User updates the 'Problem' field available in the incident form manually without availing the UI Action 'Create Problem'. In that case the above script won't run and your requirement will not meet.


Hence I would encourage you to opt for the below Business rule which will be applicable for the above mentioned scenario as well as whenever the user clicks the UI Action 'Create Problem'.



(function executeRule(current, previous /*null when async*/) {


  var prob =   new GlideRecord('problem');


  prob.addQuery('sys_id', current.problem_id);


  prob.query();


  if(prob.next()){


  prob.assignment_group = current.assignment_group;


  prob.update();


  }


})(current, previous);



find_real_file.png


find_real_file.png



I hope this helps. Please mark correct/helpful based on impact


View solution in original post

6 REPLIES 6

sb1186
Kilo Guru

Hi Sasidhar,



When you create a problem from incident using the OOB UI action Create Problem, you can copy the current assignment group on the incident record to that on the problem record by updating the script in the UI action to include the following statement:



prob.assignment_group = current.assignment_group;



The code would look something like:



var prob = new GlideRecord("problem");


prob.short_description = current.short_description;


prob.cmdb_ci = current.cmdb_ci;


prob.priority = current.priority;


prob.company = current.company;


prob.assignment_group = current.assignment_group; //copies the incident assignment group to the problem record


prob.sys_domain = current.sys_domain;


var sysID = prob.insert();



current.problem_id = sysID;


var mySysID = current.update();


gs.addInfoMessage("Problem " + prob.number + " created");


action.setRedirectURL(prob);


action.setReturnURL(current);



Let me know if this works for you.



PS: Mark this answer as Correct if it solved your query or hit Like/Helpful depending upon the usefulness of the response.



Regards
Supriya Bisht


Dave Smith1
ServiceNow Employee
ServiceNow Employee

when we relate any problem to that incident then the assignment group in problem must be auto populated as the same which we selected in incident .



Is this the right approach?



Usually a team that does problem management isn't involved in incident resolution - problem investigation and diagnosis tends to be a second-line activity, but incident management is a frontline responsibility (service-desk stuff).



What happens if several incidents with different assignment groups are linked to the same problem record?   Which group is then picked?