Existing catalogue form will be visible to All Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 07:20 AM
Hi Community,
Existing catalogue form will be visible to All the Users, But is there any way to modify existing workflow where if the user is Brazil then the request should land to Brazil assignment group.
Regards,
Srinivasu Sagiraju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2023 05:33 AM
Hi @Srinivasu2 ,
you can also directly assignee assignment group depends on your locations add if conditions .
var userLocation = gs.getUser().getLocation();
if (userLocation == 'Brazil') {
current.assignment_group = 'BrazilAssignmentGroupSysID'; // Replace with the actual Sys ID of the Brazil assignment group
}
If the solution works, please consider marking it as helpful.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2023 05:46 AM
Ok @Anand Kumar P , finally i have 2 questions
1) but in if condition we should use the below format right?
2. Brazil is a country right not any particular location?
Thank you in advance
Regards,
Srinivasu Sagiraju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2023 06:09 AM - edited 09-30-2023 06:15 AM
Hi @Srinivasu2 ,
Take one run script activity from workflow and add below script in that run script if you want logged in user country.
var user = new GlideRecord("sys_user");
user.addQuery("sys_id", gs.getUserID());
user.setLimit(1);
user.query();
if (user.next()) {
var country = user.location.country;
if (country == 'Brazil') {
current.assignment_group = 'sys_id of Brazil assignment group';
}
}
(or)
If you want requstor country use below script
var ritm = new GlideRecord("sc_req_item");
ritm.addQuery("sys_id", current.variables.ritm);
ritm.setLimit(1);
ritm.query();
if (ritm.next()) {
var requestorLocation = requestor.location.country;
if (requestorLocation == 'Brazil') {
current.assignment_group = 'sys_id of Brazil assignment group';
}
}
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2023 06:30 AM
1) But if he is not a Brazil user the flow will continue,
2) If he is brazil user RITM auto assigned to Brazil assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2023 06:43 AM
Hi @Srinivasu2
If the user is not Brazil then you need to design the flow as per your requirement, i.e if yes it will set the assignment group or else it will continue with the flow.