How to append string to Jenkins variable "BUILD_URL"

4k views Asked by At

I am using Cppcheck Plugin. I am trying to send Cppcheck Results URL in email once the Jenkins job is completed.

I tried setting Default Content to following:

View this URL for Cppcheck Results: $BUILD_URL + "cppcheckResult/"

But the email which I got had following text:

View this URL for Cppcheck Results: https://myurl/job/fscopy/7/+"cppcheckResult/"

Can someone help me figuring out how can I send correct URL in email which is following:

https://myurl/job/fscopy/7/cppcheckResult/
2

There are 2 answers

0
npatel On BEST ANSWER

I managed to resolved it by creating CPPCHECK environment variable and using it as below:

View this URL for Cppcheck Results: $BUILD_URL$CPPCHECK

which gave me output in email as following:

View this URL for Cppcheck Results: https://myurl/job/fscopy/7/cppcheckResult/
0
xnumad On

You can interpolate without any spaces in-between using ${BUILD_URL}cppcheckResult/