- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 08:01 AM
I am hoping to write a script on a record producer that changes who the "Opened For" user is based on what group the "Opened By" user is in.
I currently have it set up so that the Opened For person is always the Subject Person's manager (script below). However, I need it changed so that this only occurs when the Opened By is a member of a certain HR Group (Employee Relations). Is it possible to do this right on the record producer script?
I was thinking something like this:
var isER = (gs.getUser().isMemberOf("f65370019f22120047a2d126c42e705c"))
if (isER) {
return current.opened_for = producer.subject_person.manager; }
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 08:19 AM
Hi,
update as this
if(gs.getUser().isMemberOf("f65370019f22120047a2d126c42e705c")) {
current.opened_for = producer.subject_person.manager;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 08:19 AM
Hi,
update as this
if(gs.getUser().isMemberOf("f65370019f22120047a2d126c42e705c")) {
current.opened_for = producer.subject_person.manager;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 02:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 08:03 PM
Hi,
add that if statement as 1st line and then add the line 1
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 06:13 AM