Skip to end of banner
Go to start of banner

User's guide - 1.0

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Enabling JS Hooks for a repository

The first time that a repository administrator opens the JS Hooks page for the repository they will be shown "Enable" buttons that you click to enable one or more of the three available types of JS Hooks. Items enabled will only be enabled for that specific repository.

If for some reason a type of JS Hooks are disabled via this configuration screen, the administrator will be shown the "Enable" buttons again for the specific JS Hooks not currently enabled.

Writing a JavaScript hook

Writing a JS hook can be quite simple. Click on "Add Hook" on the repository JS hook page and you'll be presented with a configuration screen. In this screen:

  1. Give the hook a name
  2. Add the script for the hook into the "Script code" area.
  3. Select a change (or pull request in case of a merge check) to run against
    1. This will run your actual JavaScript code against the particular item as if it was "live". At the end of the run you can see if there was an error with your code and which of the external api calls were called (and what the arguments passed to them were).
  4. Click Save

The hook is now active. At any point though, you can disable the hook from the repository view page.

 

Troubleshooting

  • No labels