numberformat.groovy
​String aStringnumber = "123"

Integer integerNum = aStringnumber as Integer
//assert integerNum == 123

println integerNum



​aStringNumber ="234"

try {
    Long longNum = aStringNumber as Long
    println "Long number = ${longNum}"
} catch (NumberFormatException e) {
    print "this is not a number"
}


// date
import java.text.SimpleDateFormat

def pattern = "yyyy-MM-dd" 
def input = "2021-02-31"  
def date = new SimpleDateFormat(pattern).parse(input)


println "Date = ${date}"
​
incoming.groovy
issue.customFields."Expected delivery".value = replica.customKeys."Expected"
issue.priority = nodeHelper.getPriority(replica.customKeys."Priority","ABCD")

outgoing.groovy
def variables = buildVariables ...


replica.customKeys."Expected" = variables.get("Expected ...")
replica.customKeys."Priority" = variables.get("Priority ...")
replica.customKeys."Otherfield" = variables.get("Otherfield ...")