Closed beykery closed 3 years ago
Looking for the same. I figured out a workaround, it is a string after all.
def now = new Date()
def strNow = now.format("yyyy-MM-dd HH:mm:ss")
pipeline {
agent any
parameters {
string(name: 'test', defaultValue: "$strNow", description: '')
}
stages {
stage('stage1') {
steps {
script {
println "$test"
}
}
}
}
}
@LarrysGIT thx.
arameters sec
so it does not have a named function?
how can i use date parameter in jenkinsfile just like booleanParam(......) in parameters section ?