While the Adaptavist docs have some useful notes about using Behaviours with JSD and also how to make "Internal Comments" with a script, I wasn't able to find something indicating how to use Behaviours to specify the use of an "Internal Comment" instead of "Respond to Customer" on a Transition Screen.
It seems like this is probably possible, but I'm struggling on figuring out how to go about it.
The goal here is that I want to have a particular Transition Screen default to an Internal Comment prompt.
I'm doing something similar that you may find useful if you don't find a way via Behaviours.
I've got a validator set up to make sure that a comment is internal, and not external, on a particular transition:
import groovy.json.JsonSlurper
import groovy.json.JsonParserType
def returnValue = true
def commentProperty = transientVars?.get("commentProperty")?.toString()
//commentProperty will look like this: [[{key: "sd.public.comment", value: {internal: "true"}}]]
if (commentProperty != null) {
//strip the leading [[ and trailing ]] from the string
commentProperty = commentProperty.substring(2,commentProperty.length()-2)
//set Type to LAX to compensate for the fact that not all of the strings are surrounded by quotes
def props = new JsonSlurper().setType(JsonParserType.LAX).parseText(commentProperty)
returnValue = props.key == "sd.public.comment" && props.value["internal"] == "true"
}
else {
returnValue = true
}
return returnValue
So, if an agent attempts to create an external comment, he gets the error, The comment should be an Internal Comment., and he simply changes it to an internal.
The code generates a couple of static type checking warnings in the editor, but they can be ignored.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.