- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 12:05 AM
I made 2 different custom fields in sc_task table.
field1 :
u_zassignmentid
Reference(sys_user_group)
field2 :
u_zassigneeid
Reference(sys_user)
I set field2 dependent that lookup field1 value like Assignment Group and Assigned to.
But it did not work.
Why it does not work? How can i do?
Thank you for answer.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 08:01 PM - edited 01-24-2024 02:23 AM
Hi @Jaeik Lee
I see. Thanks for capturing the details.
The above behavior does not work if the dependent reference field (field 1 above in your case) does NOT include "group" in its name.
So just include the "group" word in your field1, which is referencing to the sys_user_group table. Then replace the dependent value with the new field name. And it should do the trick.
Ref: KB0998861 - Dependent field does not work as expected on task "Assigned to" field.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 12:28 AM
Hi @Jaeik Lee ,
In assigned to field dependent value use assignment_group
or
You can write reference qualifier on assignment group and use below script
var UserGroup = Class.create();
UserGroup.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getMembers : function(groupId){
gs.log("group",groupId);
var id = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery("group",groupId);
gr.query;
while(gr.next()){
id.push(gr.getValue("user"));
}
gs.log('sys_idIN+id.join();' +"sys_idIN"+id.join());
return "sys_idIN"+id.toString();
},
type: 'UserGroup'
});
javascript:new UserGroup().GetMembers(current.assignment_group);
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 12:46 AM - edited 01-23-2024 12:46 AM
I tried that in my PDI, and I got it working at first attempt for the field2 -> field1 relation.
I just put "u_zassignmentid" into the "Dependent Field" of field2, and then I could always get the right users that were in the previously selected group. I would just beautify it with a UI Policy and clear the user field when the group field is emptied.
Is your setup anyhow different? If it still doesn't work, can you maybe share a few screenshots of the field dictionary entries?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 04:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 01:59 AM
Hi @Jaeik Lee
Can you share what you have done so far and highlight any aspects that didn't function as expected?
Cheers,
Tai Vu