A couple of transitions in our Service Desk workflow are internal in nature, so a comment provided during the transition should be an internal comment. I would like to create a validator to make sure that is the type chosen, but I am coming up empty. I have found references to determining whether existing comments are internal, but in my case, the comment does not yet exist.
An example of determining whether an existing comment is internal:
def isInternal = { Comment c ->
def commentProperty = commentPropertyService.getProperty(user, c.id, SD_PUBLIC_COMMENT).getEntityProperty().getOrNull()
if (commentProperty) {
def props = new JsonSlurper().parseText(commentProperty.getValue())
props['internal']
}
else {
true
}
}Thanks!
Payne