assigmentGroup_defaultvalue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 07:08 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 07:31 AM - edited 11-19-2023 07:33 AM
In your Dictionary:
In your Script include:
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 07:48 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 07:59 AM
@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
}
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 08:02 AM
its not work