The script trigger plugin parses the string between "<description>" and "</description>" and sets as description of the build. If I need to add some variable i.e sprint week, the variable is not picked up. The method parses the entire content of execution of build and FIRST match with the given condition returned as description. A sample example -
ret=$(expr $wk % 2)
echo "<cause>Tagging for end of sprint</cause>"
echo "<description>Tag for week $wk</description>"
[Home] $ /bin/sh /Users/Shared/Jenkins/tmp/hudson6505104509343595225.sh
<cause>Tagging for end of sprint</cause>
<description>Tag for week 42</description>
The exit code is '0'.
I was actually willing to set the tag as "Tag for week 42", though I get this as "Tag for week $wk". As simple fix to get the last occurrence of the tags in the content would fix this problem. I made the changes and tested locally. It works fine for me.