assigmentGroup_defaultvalue

yardenKrispel
Tera Contributor

Hi I need help! I made a script that as soon as I write down the name it automatically returns its sys_id to me, I made the script in script included and then I connected it with the default value and it doesn't work, I attached pictures of it I would appreciate help and corrections thanks

 

 

yardenKrispel_0-1700406344392.pngyardenKrispel_1-1700406375611.png

 

18 REPLIES 18

Community Alums
Not applicable

@yardenKrispel , 

In your Dictionary:

Dictionary.PNG

 

In your Script include:

Script include.PNG

 

Note that this will apply for all tables extended from Task, if you want any specific table only, specify this inside Dictionary Override.

 

Hope this helps!

Thanks for the help! But I don't see in the code that the function should take the name of the assignment group and return its sys_id to me, I would appreciate it if you could explain to me where it is written in the code

Community Alums
Not applicable

@yardenKrispel , in the Script include:

 

getGroupbyName: function(groupName) { // The groupName is the string of group name you will pass from the Dictionary.
var gr = new GlideRecord('sys_user_group');
gr.addQuery('name', groupName);
gr.setLimit(1);
gr.query();
if (gr.next()) {
return gr.getUniqueValue(); // this will return the sys_id of the record
}
},

yardenKrispel_0-1700409728751.png

its not work