Trying to use script include in a dictionary override...

B_pppppp
Tera Contributor
I have the following situation: when the problem record is in state NEW or Assess, I want the assignment group field to show me only the groups with a certain group type. Let's call the group type 'Ana'.
Otherwise, when the problem record has another state from the assignment group field I can choose other groups, not only those with the group type 'Ana'. I created an Script include that I want to call from the dictionary override. But with no success til' now
11 REPLIES 11

Tai Vu
Kilo Patron
Kilo Patron

Hi @B_pppppp 

Since we're using the Group Type field, we don't need to query again to the Group table.

Let's try my sample below.

Script Include

var ProblemHelper = Class.create();
ProblemHelper.prototype = {
    initialize: function() {
    },

	getGroupTypeForRefQual: function(problem){
		var state = problem.getValue('state');
		//1cb8ab9bff500200158bffffffffff62: group type 'itil'
		var groupType = (state == 101 || state == 102) ? '<your_group_type_sys_id' : '1cb8ab9bff500200158bffffffffff62'; //replace the group type in else condition
		return groupType;
	},

    type: 'ProblemHelper'
};

 

Dictionary Override

javascript&colon; 'typeLIKE' + new ProblemHelper().getGroupTypeForRefQual(current)

Timi_0-1712744806254.png

 

Cheers,

Tai Vu

B_pppppp
Tera Contributor

It still shows all the available groups and it doesn't filter the desired group

B_pppppp
Tera Contributor

This is the situation now: I tried a new code and this also doesnt work

Replace line 19 with "return "sys_idIN" + groupList.join(',');"

 

Please mark helpful if this solves your problem.

 

Vijendra Sainy

InfoBeans

I did, also this is the reference qualifier