String interpolation is being used incorrectly here. Use just buildnumber instead of $buildnumber. If you using $buildnumber, use ‘$buildnumber’ instead(in quotes as shown).
On Wed, 12 Jun 2019 at 11:13 PM, panneerrselvam natarajan < [email protected]> wrote: > Hi All, > > > I am new to Jenkin and executing the pipeline.. Here i want to store the > build number and result in text file. > > > Here my scripts > f = new file ('pan2.txt") > f.append('newline added!\n) > echo "My file " +f > println f.text > > > The above scripts adding the content but now i want add the > env..build_number into the file > > def buildnumber = env.build_number > f.append ($buildnumber) . (not working). > > Please guide me > > Regards > Pan > > > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/f26036a2-9188-4f52-846b-6685f0d5c026%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/f26036a2-9188-4f52-846b-6685f0d5c026%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- *Best Regards,* *Jacob Dany* *contact - +65 90224437* -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAD%2BZqMnxMiU1k3tWxO%3DZ1BcfYZUg7WnkFV0f9rsaiYATvzxsrQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
