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

Create easier method to use content tokens in groovy templates

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently you have to import all the content token plugins you want to use, create an instance and then call the getContent method to use the email-ext tokens in a groovy template. It would be nice to have an easier method to do this, where you could do something like:

      ENV(var: 'MY_VAR')

      To use the ENV content token.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
          src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java
          src/main/java/hudson/plugins/emailext/ScriptSandbox.java
          src/main/java/hudson/plugins/emailext/plugins/ContentBuilder.java
          src/main/java/hudson/plugins/emailext/plugins/EmailTrigger.java
          src/main/java/hudson/plugins/emailext/plugins/content/ScriptContent.java
          src/main/resources/hudson/plugins/emailext/ExtendedEmailPublisher/config.groovy
          src/main/resources/hudson/plugins/emailext/templates/email-ext.groovy
          http://jenkins-ci.org/commit/email-ext-plugin/88aa3db61db603ff31acfa6844e15fba200bd5b7
          Log:
          Fix JENKINS-16916

          • Updated ScriptContent to use better groovy setup.
          • In default groovy script, add all content types as closures, these can
            be used like ${ENV(var: "BUILD_ID")} in the groovy template
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java src/main/java/hudson/plugins/emailext/ScriptSandbox.java src/main/java/hudson/plugins/emailext/plugins/ContentBuilder.java src/main/java/hudson/plugins/emailext/plugins/EmailTrigger.java src/main/java/hudson/plugins/emailext/plugins/content/ScriptContent.java src/main/resources/hudson/plugins/emailext/ExtendedEmailPublisher/config.groovy src/main/resources/hudson/plugins/emailext/templates/email-ext.groovy http://jenkins-ci.org/commit/email-ext-plugin/88aa3db61db603ff31acfa6844e15fba200bd5b7 Log: Fix JENKINS-16916 Updated ScriptContent to use better groovy setup. In default groovy script, add all content types as closures, these can be used like ${ENV(var: "BUILD_ID")} in the groovy template
          Hide
          slide_o_mix Alex Earl added a comment -

          Added the ability to use the content tokens more easily in groovy templates.

          Show
          slide_o_mix Alex Earl added a comment - Added the ability to use the content tokens more easily in groovy templates.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              slide_o_mix Alex Earl
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: