- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2022 02:57 PM
Hi there
I have a catalog item which has a REST workflow, the rest message is being sent thru successfully, just the servicenow request shows up with this error in workflow log
'Wrapped org.mozilla.javascript.EvaluatorException: missing ; before statement (Spark Adaptive Inventory(3987e86ddbd2c914b8846c1305961901); line 1) (sys_trigger.56632d1e1b06015055f2baeccc4bcb1d; line 2'
the workflow goes into a loop, even though the REST Message is successfully sent thru
any idea please?
Thanks
Levino
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2022 08:24 PM
Hi
it seems that the script within the Workflow activity is faulty.
Therefore please share the script.
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2022 08:24 PM
Hi
it seems that the script within the Workflow activity is faulty.
Therefore please share the script.
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2022 09:50 PM
workflow.scratchpad.environment = current.variables.environment;
var profile = current.variables.profile.toString();
var str = profile.split(',');
var roleName = [];
for (var i = 0; i < str.length; i++) {
var grRole = new GlideRecord('u_cmdb_ci_application_role');
grRole.addQuery('sys_id', str[i]);
grRole.query();
if (grRole.next()) {
roleName.push(grRole.name);
}
}
var list = roleName.join(',');
workflow.scratchpad.profile = list;
var requested_for = current.variables.requested_for;
var requestorForRecord = new GlideRecord('sys_user');
requestorForRecord.addQuery('sys_id', requested_for);
requestorForRecord.query();
if (requestorForRecord.next()){
workflow.scratchpad.full_name = requestorForRecord.name;
}
var requestorForEmail = new GlideRecord('sys_user');
requestorForEmail.addQuery('sys_id', requested_for);
requestorForEmail.query();
if (requestorForEmail.next()){
workflow.scratchpad.email = requestorForEmail.email;
}
var requestorForTnumber = new GlideRecord('sys_user');
requestorForTnumber.addQuery('sys_id', requested_for);
requestorForTnumber.query();
if (requestorForTnumber.next()){
workflow.scratchpad.spark_tnumber = requestorForTnumber.employee_number;
}
var time = new GlideDateTime().getNumericValue();
workflow.info(time + " Profile: " + workflow.scratchpad.profile);
workflow.info(time + " Full Name: " + workflow.scratchpad.full_name);
workflow.info(time + " Email: " + workflow.scratchpad.email);
workflow.info(time + " Tnumber: " + workflow.scratchpad.spark_tnumber);