-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.7.4
Pipeline suite plugin 2.4
Hi,
The following date/time arithemetics which work in groovy - do not work in a pipeline script:
import groovy.time.* def startDate = new Date() def timeout = startDate + 1.hours //increment 1 hour
use( TimeCategory ) doesn't help.
I get the following error:
groovy.lang.MissingPropertyException: No such property: hours for class: java.lang.Integer
I also wasn't able to find any workaround for this - I was only able to increment integers (as in days)
[JENKINS-40154] groovy date arithmetics do not work in pipeline
Description |
Original:
Hi, The following date/time arithemetics which work in groovy - do not work in a pipeline script: {code:java} import groovy.time.* def startDate = new Date() def timeout = startDate + 1.hours //increment 1 hour {code} I get the following error: groovy.lang.MissingPropertyException: No such property: hours for class: java.lang.Integer |
New:
Hi, The following date/time arithemetics which work in groovy - do not work in a pipeline script: {code:java} import groovy.time.* def startDate = new Date() def timeout = startDate + 1.hours //increment 1 hour {code} I get the following error: groovy.lang.MissingPropertyException: No such property: hours for class: java.lang.Integer I also wasn't able to find any workaround for this - I was only able to increment integers (as in days) |
Description |
Original:
Hi, The following date/time arithemetics which work in groovy - do not work in a pipeline script: {code:java} import groovy.time.* def startDate = new Date() def timeout = startDate + 1.hours //increment 1 hour {code} I get the following error: groovy.lang.MissingPropertyException: No such property: hours for class: java.lang.Integer I also wasn't able to find any workaround for this - I was only able to increment integers (as in days) |
New:
Hi, The following date/time arithemetics which work in groovy - do not work in a pipeline script: {code:java} import groovy.time.* def startDate = new Date() def timeout = startDate + 1.hours //increment 1 hour {code} use( TimeCategory ) doesn't help. I get the following error: groovy.lang.MissingPropertyException: No such property: hours for class: java.lang.Integer I also wasn't able to find any workaround for this - I was only able to increment integers (as in days) |
Component/s | New: workflow-cps-plugin [ 21713 ] | |
Component/s | Original: pipeline [ 21692 ] |