Assigning a Group to a CI instead of a single user

skylarbarth
Kilo Expert

Hello all,

I was curious if there is a simple way to, instead of having CIs relate to a single user, if they would relate to a group.

My thought process is that if there is a service disruption and an incident is logged against ServerXYZ or BusinessServiceABC, it would be nice to have predefined groups that manage ServerXYZ and the Business Service. Instead of just having one persons name on it, and getting user.parent.group() if we could just take the ci.assignment_group() and set that to be the incident.assignment_group().

Best,

1 ACCEPTED SOLUTION

yeah, I figured that one out.


I am working on trying to make the assignment group of the inc snap to the assignment group of the ci now via client script + script include as per another users findings ...



Set Assignment Group based on Configuration Item



its not working out so far though, my answer is coming back as null



function onChange(control, oldValue, newValue, isLoading) {


    if (isLoading || newValue == '' || g_form.getValue("assignment_group") != "") {


          alert("bail");


  return;


    }




    //Type appropriate comment here, and begin script below



alert("calling");



var ga = new GlideAjax("u_incidentFunctions");


ga.addParam("sysparm_name","u_getActiveGroup");  


    ga.addParam("sysparm_ci",newValue.toString());


alert(ga);


    ga.getXMLAnswer(parseAnswer);  


     


alert("finished");



    function parseAnswer(answer) {  


  alert("perf action");


  alert(answer);


          g_form.setValue("assignment_group", answer);  


    }  



   


}


View solution in original post

11 REPLIES 11

You might want to take a look at assignment rules to avoid scripting.



Defining Assignment Rules - ServiceNow Wiki


Ah, I'll check out that approach, would you say that could be best practice, over scripting?



Best,


Wait, so this would be defining the "assignment groups" in these rules, not, per say, in the CI itself?


If so, that would be less than ideal -


Thoughts?


Ok, I got it to work, was a mix of spelling mistakes for the most part assignment*



I have a question now, I made a user, and assigned ITIL role, this user cannot see any of the groups in the 'assignment' section. So even though the value is getting auto snapped, they can't see that assignment group, I've confirmed I can see the group auto populate as I want under an admin account -



Thoughts?


"Number of rows removed from this list by Security constraints: 20"