script error

jean-pauldehaas
Tera Guru

Hi All,

in my workflow there is an advanced script to do a few checks, but it keeps giving me an error.

can someone point me in the right direction were to look ?

org.mozilla.javascript.WrappedException: Wrapped ConversionError: The undefined value has no properties. (// Set values for the task in this script.  Use the variable 'task' when setting additional values.
// Note: This script is run after the task values are set using the Fields, Template or Values you have specified.
//
// For example:
//     task.short_description = current.short_description;
//task.short_description = "New Keyboard request fulfillment";
var supportloc = ifScript();
function ifScript() {
    var usr = current.variables.requested_for.toString();
    var usrloc = new WorkflowUtils().getUsersHomeOffice(usr);
    var zug = gs.getProperty("LKQ_Zug_Office");
    if (usrloc == zug) {
        return 'zug';
    }
    return 'isc';
}

task.description = "Create cloud only email account, enable MFA & configure groups for new employee";
var temp = current.cat_item.name;
if(temp == 'LKQ EU Onboarding Request (HR)'){    
        task.short_description = "Configure account for new employee";
        task.assignment_group = new WorkflowUtils().getTaskAssignmentGroupByTaskID(workflow.name,'newemployeeISC_task');
}
; line 9) (sys_script_include.365eca63c0a8016600069528aee5affb.script; line 117)

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

so these lines are written where?

task.description = "Create cloud only email account, enable MFA & configure groups for new employee";
var temp = current.cat_item.name;
if(temp == 'LKQ EU Onboarding Request (HR)'){    
    task.short_description = "Configure account for new employee";
    task.assignment_group = new WorkflowUtils().getTaskAssignmentGroupByTaskID(workflow.name,'newemployeeISC_task');
}

Also the error says error at line 117 in script include. Did you check that?

Regards
Ankur

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

so these lines are written where?

task.description = "Create cloud only email account, enable MFA & configure groups for new employee";
var temp = current.cat_item.name;
if(temp == 'LKQ EU Onboarding Request (HR)'){    
    task.short_description = "Configure account for new employee";
    task.assignment_group = new WorkflowUtils().getTaskAssignmentGroupByTaskID(workflow.name,'newemployeeISC_task');
}

Also the error says error at line 117 in script include. Did you check that?

Regards
Ankur

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

oh i missed that part about the script include, the issue could be there then..

yes also check what are you sending in this variable -> workflow.name

Regards
Ankur

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

Hi Ankur,

 

kindly help me with the below link

 

https://www.servicenow.com/community/hrsd-forum/hi-team-i-need-help-with-lifecycle-event-approval-ac...

 

Thank you in advance