Frequent update to system property -Alternative script

Hemant Kumar Ch
Kilo Sage

Hello Experts

 

We are using the Below script for Auto Assignment of tickets in a Circular Pattern but as someone suggested frequent updates of system property will cause performance issues 

 

Is this true even if we checked to ignore the cache?

 

Any better alternatives or Suggestions 

 

var GRPSYS_ID = 'd625dccec0a8016700a222a0f7900d06'; //Put the sys_id of the assignment group (or groups comma separated) here. Or set this in a system property and grab it here.
	var lstAssigned = gs.getProperty("rr.last_assigned_to"); //Get the sys_id of the user most recently assigned to by this rule.

	//Make an array of all users in the group(s), ordered alphabetically by name:
	var userList = [];
	var userHasGroup = new GlideRecord('sys_user_grmember');
	userHasGroup.addQuery('available', true);
	userHasGroup.addQuery('group', 'IN', GRPSYS_ID);
	//userHasGroup.orderBy('user.name');
	userHasGroup.query();
	while (userHasGroup.next())
		userList.push(userHasGroup.getValue('user'));

	var nextUserIndex = userList.indexOf(lstAssigned) + 1;
	if (nextUserIndex == userList.length)
		nextUserIndex = 0;
	var nextUser = userList[nextUserIndex];
	current.assigned_to = nextUser;
	gs.setProperty("rr.last_assigned_to", nextUser); //Update the property with the sys_id of the user most recently assigned to by this rule.

 

Thanks In Advance

4 REPLIES 4

Ct111
Tera Sage

yes this is true.

 

Read this thread from Servicenow Support.

Hello. 

 It means I can use without worries if i checked ignore cache ?

 

Do you suggest any another alternative solution?

 

 

 

 

 

 

 

Ct111
Tera Sage

No it means avoid changing system properties in production else there will be performance issue.

 

And if there is a scenario where there is NO alternative left apart from changing the system property then I would suggest you to load your update set in OFF BUSINESS HOURS so that they won't experience any issue while using system.

Hi 

 

Could you suggest any alternative solution instead of system properties 

 

Use case : Auto assignment of incidents in Circular pattern if four users available it should allocate them in Circular pattern

 

Needed it Urgent

 

Reg