A user requires a sample snippet to trigger a Map/Reduce script with Task module with custom script parameters.
let mapReduceData = new Object;
mapReduceData[“dataArray”] = dataArray
let mrTask = task.create({
taskType : task.TaskType.MAP_REDUCE
});
var scriptParams = {};
scriptParams.custscript_datastring = JSON.stringify(mapReduceData);
mrTask.scriptId = “customscript_generate_coupon_mr”;
mrTask.deploymentId = “customdeploy_generate_coupon_mr”;
mrTask.params = scriptParams;
mrTask.submit();.