Interface HookScript
- All Superinterfaces:
MinimalHookScript
A script represents some form of executable, such as a shell script or binary, which can be run in response to repository changes. Scripts are managed separately from the repositories where they're enabled to simplify the process of administering them. For example, if a given script is enabled in 2,000 different repositories, it can be updated in, or deleted from, all of them simultaneously with a single operation.
- Since:
- 6.2
-
Method Summary
Methods inherited from interface com.atlassian.bitbucket.hook.script.MinimalHookScript
getId, getVersion
-
Method Details
-
getCreatedDate
- Returns:
- the date the script was created
-
getDescription
Retrieves the script's description. Descriptions are limited to 255 characters but are otherwise free-form.- Returns:
- the script's description
-
getName
Retrieves the script's name. Names are limited to 255 characters but are otherwise free-form.When a
pre
-style hook script rejects an update, the script's name is included in theveto
added to thehook result
. Like a filename, hook script names should be short, but descriptive. (However, unlike a filename, filesystem limitations do not apply to hook script names.)- Returns:
- the script's name
-
getPluginKey
Retrieves the plugin key for the app which created the script. Plugin keys are limited to 255 characters.When a script is created, the app which creates it must provide its plugin key. This allows scripts to be associated with the app that created them, for administrative purposes.
Note: App developers are strongly discouraged from changing their plugin keys. While the key associated with a hook script can be updated later, this is only one of many references the overall system may have to an app's plugin key.
- Returns:
- the plugin key for the app which created the script
-
getSize
int getSize()- Returns:
- the size of the script's contents
-
getType
Retrieves the script's type.Hook scripts can be written to be invoked as
PreRepositoryHook
s orPostRepositoryHook
s. The type must be specified when the script is created, and cannot be updated after.- Returns:
- the script's type, indicating whether it will be invoked before or after changes are accepted
-
getUpdatedDate
- Returns:
- the date the script was last updated
-