Skip to content

Instantly share code, notes, and snippets.

  • Save nickname55/14adeb937e58505b7020a6afdadbbcfc to your computer and use it in GitHub Desktop.
Save nickname55/14adeb937e58505b7020a6afdadbbcfc to your computer and use it in GitHub Desktop.
import groovy.json.JsonParserType
import groovy.json.JsonSlurper
def commentProperties = transientVars["commentProperty"] as String[]
if (commentProperties && commentProperties.size() > 0) {
log.debug commentProperties.join(", ");
def isInternalComment = false
if (commentProperties) {
def commentProperty = commentProperties.first()
def props = new JsonSlurper().setType(JsonParserType.LAX).parseText(commentProperty)
isInternalComment = props.find {it.key == "sd.public.comment"}?.get("value")?.get("internal")
}
log.debug "internal = " + isInternalComment.toBoolean() as String;
return isInternalComment.toBoolean()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment