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

Page to approve / deny scripts should contain links to jobs

      I'm using the same Groovy script in multiple jobs, some of which I'd like to approve while others not. Currently, it's not possible to tell which script entry to approve / deny is coming from which job. Please add a link back to the job, and maybe also say something about where in the job the script is used (build step, post-build etc.). The header of a script to review could then e.g. look like

      [Approve] / [Devy] <a href="link to job">Groovy post-build script:</a>

      for scripts from the Groovy post-build plugin or

      [Approve] / [Devy] <a href="link to job">Groovy build step script:</a>

      for script from the Groovy plugin.

          [JENKINS-24791] Page to approve / deny scripts should contain links to jobs

          Jesse Glick added a comment -

          ApprovalContext.withItem needs to be called. (Not withItemAsKey, unfortunately, since there could be multiple scripts associated with one job.) Have to check whether this is something groovy-postbuild-plugin needs to do itself, or whether it can be automatic from SecureGroovyScript (using Stapler.currentRequest.findAncestorObject for lack of anything better).

          Jesse Glick added a comment - ApprovalContext.withItem needs to be called. ( Not withItemAsKey , unfortunately, since there could be multiple scripts associated with one job.) Have to check whether this is something groovy-postbuild-plugin needs to do itself, or whether it can be automatic from SecureGroovyScript (using Stapler.currentRequest.findAncestorObject for lack of anything better).

            jglick Jesse Glick
            sschuberth Sebastian Schuberth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: