public interface

MinimalHookScript

com.atlassian.bitbucket.hook.script.MinimalHookScript
Known Indirect Subclasses

Class Overview

A minimal representation of a HookScript, retaining only its ID and version.

Summary

Public Methods
long getId()
Retrieves the script's globally unique ID.
int getVersion()
Retrieves the script's version.

Public Methods

public long getId ()

Retrieves the script's globally unique ID.

When a hook script is created it is assigned an ID, which can be used to retrieve the script later in order to update or delete it, or configure it to run in a given scope. Apps are expected to track the IDs of the scripts they create so they can manage them afterward.

Returns
  • the script's ID

public int getVersion ()

Retrieves the script's version.

Each time a script's contents are updated, it receives a new version. Updating a script's description, name or plugin key does not update its version.

If a script's contents are updated concurrently, one updater will succeed and the rest will fail. If a script's metadata is updated concurrently, the last updater "wins" and other updates are overwritten.

Returns
  • the version of the script