Hi Brian,

 

Thank you for your quick response.I have tried the suggested steps and found the systems longs as mention below. It looks like does not have any value.

 

find_real_file.png

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';
  }
}

 

Prateek kumar
Giga Sage

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';
}
}

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 

 

find_real_file.png

 

find_real_file.png

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?