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

Description doesn't get the resolved variable

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          nsharma Neeraj Sharma created issue -
          nsharma Neeraj Sharma made changes -
          Field Original Value New Value
          Description 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 reason for this is, the method parses the entire content of execution of build and FIRST match with the given condition gets returned. 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.
          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 made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 166179 ] JNJira + In-Review [ 197935 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: