How to replicate the one user account's group to another user account using custom action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 12:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 01:07 AM
Hi @Pallavi Shinde2 ,
Below thread will be helpful -
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 01:16 AM
Hi @Pallavi Shinde2 ,
I assume it will be a catalog request. if yes you can use the below script logic in your workflow or in your action as needed. (adjust the script logic were every your going to use it) FYI- This can also be attained in flow/action using LOWcode.
var from = new GlideRecord('sys_user_grmember');
from.addQuery('user',current.variables.user_copy_access_from);
from.query();
while(from.next()){
var into = new GlideRecord('sys_user_grmember');
into.addQuery("user", current.variables.requested_by);
into.addQuery("group", from.group);
into.query();
if(!into.hasNext()){
into.initialize();
into.user = current.variables.requested_by;
into.group = from.group;
into.insert();
}
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....