- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2019 02:23 AM
Wanted to check group type using if activity in workflow
this is a workflow for a requested item. The If conditions depend on the field value which refer to group table, i want to check only two group types either it is Support or Finance
Any suggestions on how to correct code below..
answer = ifScript();
function ifScript() {
var usrObj = new GlideRecord('sys_user_group');
usrObj.get(current.variables.cat_item_assignment_group);
if (usrObj.type == 'Support') {
return 'yes';
} else {
return 'no';
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2019 02:27 AM
Hi,
replace
if (usrObj.type == 'Support') {
With
if (usrObj.type.getDisplayValue() == 'Support' || usrObj.type.getDisplayValue() == 'Finance') {
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2019 02:44 AM
thanks for quick response i really appreciate
now its working with below code
answer = ifScript();
function ifScript() {
var usrObj = new GlideRecord('sys_user_group');
usrObj.get(current.variables.cat_item_assignment_group);
if (usrObj.type.getDisplayValue() == 'Support' || usrObj.type.getDisplayValue() == 'finance') {
return 'yes';
} else {
return 'no';
}
}