Jenkins : ScriptTrigger Plugin

Plugin Information

Distribution of this plugin has been suspended due to unresolved security vulnerabilities, see below.

The current version of this plugin may not be safe to use. Please review the following warnings before use:

This plugin is up for adoption. Want to help improve this plugin? Click here to learn more!

ScriptTrigger makes it possible to monitor an environment with a script.


The ScriptTrigger plug-in enables you to configure the polling predicate by the evaluation of a script.

Two types of script are supported
* Groovy script
If the expression evaluation returns true, a build is scheduled.
* Shell or Windows Batch script
A script is executed and a build is scheduled if the exit code matches your expected exit code.

For both types, if the script execution output contains the content <cause>YOUR_SCHEDULED_CAUSE</cause>, 'YOUR_SCHEDULED_CAUSE' is used as the build cause.
Additionally, if the script execution output contains the content <description>MY DESCRIPTION</description>, the 'MY DESCRIPTION' value is attached to the run.

Note: The plug-in uses only persistence in memory. There is no impact on the Jenkins infrastructure (no new files created).
This plugin provides a polling typology among the XTrigger Plugin.

Known limitations

Impossible to combine it with EnvInject plugin

Script Trigger plugin enables you to run an external script for knowing if job has to be scheduled, whereas EnvInject enables you to control environment variables when the job runs. Therefore, scripttrigger and EnvInject have 2 disctinct objectives. In conclusion, it is not possible to exploit envinject configuration. Your Script has to be standalone and independent from the job. Export your environment variables directly from your script.



Release 0.34

* Fix JENKINS-33328 - Cannot run trigger script on a slave node

Release 0.33

* Fix JENKINS-31017 - Description doesn't get the resolved variable

Release 0.32

* Add a MIT Lisence for all sources

Release 0.31

* Fix JENKINS-19379 - The scripttrigger plugins fails to load the parameter files when the System script is in use.

Release 0.30

* Fix JENKINS-18667 - NullPointerException when saving job config

Release 0.29

* Adding envvar replacement for groovyFilePath

Release 0.28

* Fix JENKINS-17641 \ Unknown field 'logEnabled' in org.jenkinsci.lib.xtrigger.XTriggerCause

Release 0.27

* Fix reopened JENKINS-17566 - Severe polling error when using script trigger

Release 0.26

* Fix JENKINS-17566 - Severe polling error when using script trigger

Release 0.25

* Test if the node is active when the polling do the work

Release 0.24

* Updat to xtrigger-lib 0.20
** Refactor error management

Release 0.23

* Fix polling issue by updating to org.jenkins-ci.lib:xtrigger-lib:jar:0.19:compile
- org.jenkins-ci.lib:envinject-lib:jar:1.16:compile

Release 0.22

* Re-adding newLine to line read in script content

Release 0.21

* Fix JENKINS-14535 - Fails to poll when no executors on master

Release 0.20

* Fix JENKINS-14104 - Use same node which has been specified in the "Restrict where this project can be run" field

Release 0.19

* Try to delete generated temporary file
* Upgrade to xtrigger-lib 0.12

Release 0.18

* Add an option to have concurrent builds
* Update to xtrigger-lib 0.11

Release 0.17

* Fix JENKINS-13542 - Backslashes in Environment / Script-Variables are not quoted correctly for Groovy
* Update to xtrigger-lib 0.10

Release 0.16

* Fix JENKINS-13208 - Use EnvVarsResolver for Groovy scripts
* Fix JENKINS-13209 -Support System Groovy scripts
* Merge pull request

  • Add system script checkbox in configuration UI
  • Add log/out/job variables to groovy shell
  • Setup the SYSTEM user during script execution
  • Log envvars used for script re-writing
  • Log messages and stack traces if the groovy script fails

Release 0.15

* Update to xtrigger-lib 0.8

Release 0.14

* Update to xtrigger-lib 0.7

Release 0.13

* Fixed JENKINS-11907 - scripttrigger doesn't close file

Release 0.12

* Environment variables are taken into account

Release 0.11.1

* Removed duplicate script resolution

Release 0.11

* Added cause and description attachment if they are present in the script execution output

Release 0.10

* Added the ability to inject environment variables with the EnvInject Plugin.

Release 0.9

* Added environment and job variables resolution to the script content

Release 0.8

* Fixed JENKINS-11042 - IOException when running ScriptTrigger with slaves
* Built for 1.409 (LTS series compatibility)
* Fixed log polling file

Release 0.7

* Fixed script execution node
* Refactoring

Release 0.6

* Added Jenkins environment variables resolution in script execution

Release 0.5

* Added the ability to provide scripts with a file path

Release 0.4.1

* Fixed a hep plugin message

Release 0.4

* Added a polling an the exit code of a shell script or a Windows batch script.

Release 0.3

* Improved help files
* Added a check: executing the script only if the Jenkins instance is not isQuietingDown() and the job is buildable

Release 0.2

* Added the feature: 'Can specify job properties as a properties file'

Release 0.1

* Initial release