Skip to content

Action definitions

Actions in CYBERQUEST automation can be scripted and made custom. This is accomplished by using JavaScript.

In order to add custom actions, the process is to add a new "DTS" object. The data that flows into the script can be accessed by using the "Event" object.


// new action to be executed in CQ Automation
// input data can be accessed by employing the "Event"

let currentInputData = Event;

if (currentInputData.EventID==4624 ) // validates a field in the event section
{
    // do something
}
else
{
    // do something else
}

By default, the javascript section for each DTS lets users customize all the actions which need to be performed. You can use all Javascript functionality. External data, API based can be used to trigger some custom usecases:


let result = CQ.Communications.HttpRequest.get('https://www.exampleAPI.com');
// result will be an object of HttpResponse

let resultAsJSON = result.asJson();

if (resultAsJSON.exampleResponseProperty=="200"){
    // do something
}
else
{
    //do something else
}

All functionality withing CQ Api is exposed and can be used in these objects. For reference please go to this link: CYBERQUEST API