Forum Discussion

zorglups's avatar
zorglups
Occasional Contributor
6 years ago

Property Expansion Dynamic Expression issue with brace character.

Here is my Property Dynamic Expression: ${= use (groovy.time.TimeCategory) {2.years.from.now.format('yyyy-MM-dd')}}   Upon evaluation, this trows this error: startup failed: Script47.groovy: 1: ...
  • JKolosova's avatar
    JKolosova
    6 years ago

    Hi zorglups,

    The following script works fine for me:

    use(groovy.time.TimeCategory){"${2.years.from.now.format('yyyy-MM-dd')}"}

    But it seems there is no way to use it in property expansions directly because of its complexity. Instead, you can try to place the script inside some Groovy test step, and then extract its result by using this property expansion:
    ${Groovy Script#result}

    How does it work for you?