- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 06:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 08:17 AM
hi Naresh - It looks like the values are there. They are the sys_ids of the 2 fields.
You might try moving your variable declaration before the function
var manager = current.variables.nh_manager;
var openedBy = current.opened_by;
answer = ifScript();
function ifScript() {
if (manager == openedBy) {
return 'yes';
} else{
return 'no';
}
}
and/or converting the values to a string:
var manager = current.variables.nh_manager.toString();
var openedBy = current.opened_by.toString();
answer = ifScript();
function ifScript() {
if (manager == openedBy) {
return 'yes';
} else{
return 'no';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 08:33 AM
Try this
answer = ifScript();
function ifScript() {
var manager = current.variables.nh_manager.toString();
var openedBy = current.variables.opened_by.toString();
if (manager == openedBy) {
return 'yes';
} else{
return 'no';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 02:45 AM
Hi Prateek,
Thank you for helping me with this script. After using this script in both cases (request raised by Manager & Others) Catalog Item is triggering approval workflow but it does not show the approver name.
I think we have to see that user (sys_user) id mentioned in Manager field and opened_by should be same then only it will skip the manager approval.
In variable nh_manager I have selected type is reference which pulls users from sys_user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 06:45 AM
I dont see any approval record in your screenshot.
The stage you are point in the screenshot needs to be adjusted at the WF level.
Can you show how the workflow looks like?