Ankur Bawiskar
Tera Patron

Hi,

you can query sys_user table with the field against which the value is entered

what does the position manager show? user_name or name of the user?

Based on that you can query and get the sys_id

For example I am querying with name field

if (gs.getUser().isMemberOf("f65370019f22120047a2d126c42e705c")) {
    var gr = new GlideRecord("sys_user");
    gr.addQuery("name", producer.employee_details_position_manager);
    gr.query();
    if (gr.next()) {
        current.opened_for = gr.getUniqueValue();
    }
}

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post