- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 08:29 AM
Hi,
I wonder if someone has done that before. In a workflow for a request item, verify if the person that opened the request is member of two specify groups.
here is what I have so far, and error that I got in the Flow
//Verify if the user that opened the request is member of a certain groups
answer = ifScript();
function ifScript() {
if (current.opened_by.isMemberOf('GROUP1') || current.opened_by.isMemberOf('GROUP2')) {
return 'yes';
}
return 'no';
}
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 08:40 AM
Hi Julia,
Can you try below script:
//Verify if the user that opened the request is member of a certain groups
answer = ifScript();
function ifScript() {
var ourUser = gs.getUser();
ourUser = ourUser.getUserByID(current.opened_by);
if (ourUser.isMemberOf('GROUP1') || ourUser.isMemberOf('GROUP2')) {
return 'yes';
}
return 'no';
}
Please mark answer as correct/helpful, if it was really helpful
Regards,
Solutioner
Enhance Knowledge NOW@ www.solutioningnow.com
http://www.solutioningnow.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 10:15 AM
No problem, Have a great a day
Regards,
Solutioner
Enhance Knowledge NOW@ www.solutioningnow.com
http://www.solutioningnow.com/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2015 10:51 PM
Hi Solutioner,
Can you help me on this, as I am getting getQuestion is not a function error in catalog task activity in workflow, before upgrading to eureka its work fine in the below code.
var msg = "Options:\n";
for (key in current.variables) {
var v = current.variables[key];
if(v.getGlideObject().getQuestion().getLabel() != '') {
msg += ' ' + v.getGlideObject().getQuestion().getLabel() + " = " + v.getDisplayValue() + "\n";
}
}
msg += "\nPlease fill the question with the group that will be assigned the next task";
task.description = msg;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 12:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 12:46 PM
I have switched this thread into a question. Thank you for letting me know solutioner now
It's always good practice to ask yourself "does this thread require an answer" before publishing. That way you can specify if it is question or a discussion. Discussions are best saved for thought posts or getting opinions on things. Questions are good for "how to.." and "is there a way to.." type questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2014 01:07 AM
I have the same issue. Thank very much for your answer! It work fine.
Regards,
Danny