Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31017

Description doesn't get the resolved variable

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • scripttrigger-plugin
    • None

      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 -
      wk=$(date +%W)
      ret=$(expr $wk % 2)
      echo "<cause>Tagging for end of sprint</cause>"
      echo "<description>Tag for week $wk</description>"
      exit $ret
      [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.

            gbois Gregory Boissinot
            nsharma Neeraj Sharma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: