jenkins with groovy postbuild .Not able to execute anything in groovy script field

1.1k views Asked by At

I need to run set of code after the build is completed. I use groovy postbuild plugin(version2.2). I am new to jenkins and groovy. I tried simple println but it is not working. I tried something like this and its also not working. I dont even see error message if i make any syntax or something. groovy

and i see this output

console output

can anyone tell me how do i use groovy postbuild ?

1

There are 1 answers

1
DenizU On BEST ANSWER

Your groovy postbuild configuration and syntax look fine to me.

I assume you are experiencing this with a Build Flow type job. I can reproduce this behavior with a configuration similar to yours and I suspect that it is related to the build flow.

One solution that worked for me was to enable the Flow run needs a workspace checkbox in the Flow section of the job configuration and start a new build.