0

When a new user joins the company, there is a request created by RITM. Where it create user id's by name but I think it didn't check user id which is deactivated. Kindly let me know how to achieve above in the quickest way in servicenow under workflow.

Nick
  • 138,499
  • 22
  • 57
  • 95
Rai G
  • 1
  • 1

2 Answers2

0

Write the run script in your workflow that you check their email id. Once check your received email i.e. emails logs. Because on the creation of every request an email inbound action will be triggered.

Thanks, PKG

0

Add a run script activity in your workflow. With your given variables (first name, last name, email, etc.) you can check if there is an existing record in the sys_user table.

var userGr = new GlideRecord('sys_user');
userGr.addQuery('first_name', <first_name>);
userGr.addQuery('last_name', <last_name>);
userGr.addQuery('email', <email>);
userGr.addQuery('user_name', 'CONTAINS', <computed_user_id>);
userGr.query();
if(userGr.next()){
  gs.log('User: ' + <first_name> + ' ' + <last_name> + ' already exists.');
  // Here you could add some code what should happen if the user exists
}
t3chnico
  • 64
  • 6