Reference

Inskill scripts run based on events at the start or end of a task. The script interacts with the task through a predefined object ds.

Methods:

ds.hasData(key) - where key refers to the name of a variable in the data set. Use to test if the key has a value.

if (ds.hasData("pressure")) {
  // do something with ds.getData("pressure")
}

ds.getData(key) - safely get the value of a variable, or null

ds.setData(key, value) - set a variable in the task's data

ds.removeData(key) - remove an existing variable

ds.getOwner() - the user who is running the task

ds.sendEmail(to, [body, subject]) - send email to the to address. Default is json of the task. Include the body and subject to format the email to be readable.

ds.sendEmail("[email protected]"); 
let body = `Support escalation \n asset ${Inskill.Session.asset.sn}`;
ds.sendEmail("[email protected]", body, "Escalation"); 

ds.userLog(message) - writes the message into userlog, can log escalations, tasks with problem conditions, etc.

ds.task - the name of the task

ds.start - timestamp when the task started. unix style seconds since time began in 1970. Use the package moment to format into readable string, etc.

ds.end - timestamp when the task ended (optional, if task has ended)

ds.data - the raw set of data as an object

ds.code - handoff code (optional)

ds.language - the language used, in 2 letter code eg "en", "fr", "ch"

ds.step_count - the number of steps used in the task. Will be 0 for context augmentation.