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

HTML Publisher does not allow environment variables in fields

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • htmlpublisher-plugin
    • None
    • Jenkins 2.46.3
      htmlpublisher 1.13
      Windows Server 2012 R2 64-bit
      Java(TM) SE Runtime Environment 1.8.0_66-b18

      When trying to use a parameter or an environment variable in the publisher, the value is taken literally instead of getting evaluated.

      I try using a parameter in the report name and the variable was not evaluated:

      Jenkins Console Log:

      [htmlpublisher] Archiving HTML reports...
      [htmlpublisher] Archiving at PROJECT level C:\Temp\TN-alpha_it\coverage-alpha to C:\PSI-APPS\Jenkins\jobs\DEV\jobs\it\jobs\tn-app_it\htmlreports\OpenCover_-_Code_Coverage_-_${INSTANCE}

       

          [JENKINS-44786] HTML Publisher does not allow environment variables in fields

          Hector Santana created issue -

          Hi Hector - you are correct. Currently only the report directory and index pages fields will expand out variables.

          I've changed this from a bug to an improvement as it's never been designed to expand out the Report Title, however I can see that doing so would be useful.

          I'll add it to the list of things to look into - thanks for bringing it up!

          Richard Bywater added a comment - Hi Hector - you are correct. Currently only the report directory and index pages fields will expand out variables. I've changed this from a bug to an improvement as it's never been designed to expand out the Report Title, however I can see that doing so would be useful. I'll add it to the list of things to look into - thanks for bringing it up!
          Richard Bywater made changes -
          Assignee Original: mcrooney [ mcrooney ] New: Richard Bywater [ r2b2_nz ]
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]

          Thank you very much. We have a lot of parameterized jobs that have reports and I would like to segregate those reports by instance so this would be awesome to have! Thanks again for all the work.

          Hector Santana added a comment - Thank you very much. We have a lot of parameterized jobs that have reports and I would like to segregate those reports by instance so this would be awesome to have! Thanks again for all the work.

          Larry Cai added a comment -

          we like this feature as well.

          For our case, if we customize the title with "date" inside, then we can download the zip file with timestamp inside.

          Hope u have time to fix it soon.

          Larry Cai added a comment - we like this feature as well. For our case, if we customize the title with "date" inside, then we can download the zip file with timestamp inside. Hope u have time to fix it soon.
          Larry Cai made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Larry Cai made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Richard Bywater made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          I've made some changes which will hopefully bring you the ability you are both after. I've just some tidy up stuff to sort out and then I'll look at releasing a beta version to the experimental update centre so that I can get some feedback about whether it solves your issues and doesn't break anything in the process!

          Will update details here when that is available. I'll leave the general release of this functionality until after the Christmas period as not wanting to break things whilst I might not be available to fix!

          Richard Bywater added a comment - I've made some changes which will hopefully bring you the ability you are both after. I've just some tidy up stuff to sort out and then I'll look at releasing a beta version to the experimental update centre so that I can get some feedback about whether it solves your issues and doesn't break anything in the process! Will update details here when that is available. I'll leave the general release of this functionality until after the Christmas period as not wanting to break things whilst I might not be available to fix!

          r2b2_nz

          Thank you so much! You are awesome. We both appreciate your hard work. I'll check it out as soon as you release the beta!

          Hector Santana added a comment - r2b2_nz Thank you so much! You are awesome. We both appreciate your hard work. I'll check it out as soon as you release the beta!

            r2b2_nz Richard Bywater
            hsantana29 Hector Santana
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: