Created
April 21, 2022 07:31
-
-
Save nickname55/14adeb937e58505b7020a6afdadbbcfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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