Script Hub & Git Version Control User Guide
The Script Hub is your central repository in ScriptFabric for managing, organising, and reusing custom JavaScript and TypeScript scripts across your Jira Cloud site.
In addition to creating scripts manually, ScriptFabric supports importing scripts directly from GitHub and Bitbucket version control repositories.
Features Overview
- Centralized Library: Save and search scripts across your entire organization.
- Git Version Control Integration: Import scripts directly from public or private GitHub and Bitbucket repositories.
- Automated Repository Detection: Automatically tests public access for URLs and flags private repositories requiring authentication.
- PAT Permission Diagnostics: Validate Personal Access Tokens (PATs) in real time with diagnostic logs showing granted scopes and permissions.
- Script Variables Integration: Use securely stored, encrypted PATs from Script Variables or enter tokens manually.
- Tabbed Monaco Code Preview: Preview multiple fetched scripts side by side with full syntax highlighting before saving.
Step-by-Step Guide: Importing Scripts from Git
Step 1: Open the Script Import Interface
- In Jira Cloud, navigate to Apps → ScriptFabric.
- Select Script Hub from the sidebar menu.
- Click the Import Scripts button in the top action toolbar (or click Import Script on the empty state banner if your library is empty).
Step 2: Enter Repository File URLs
Enter one or more GitHub or Bitbucket file URLs into the URL text area (one URL per line).
Supported URL Formats
- GitHub Web File URL:
https://github.com/owner/repo/blob/main/path/to/script.js - GitHub Raw File URL:
https://raw.githubusercontent.com/owner/repo/main/path/to/script.js - Bitbucket Web File URL:
https://bitbucket.org/workspace/repo/src/master/path/to/script.js
Step 3: Public vs. Private Repository Detection
ScriptFabric automatically inspects each URL as you type:
- Public Repositories: Display a
Public Repositorystatus badge. ScriptFabric fetches public script content without requiring credentials. - Private Repositories: Display a
Private Repositorystatus badge and open the Authentication configuration section.
Step 4: Configure Authentication (Private Repositories)
If your script resides in a private repository, configure authentication using one of two methods:
Option A: Manual Token Entry
Select Manual Token Entry and paste your Personal Access Token (PAT) into the token input field.
Option B: Use Script Variables
Select Script Variables and choose an existing encrypted PAT key (for example, GITHUB_PAT or BITBUCKET_PAT) stored in ScriptFabric → Script Variables.
Token Validation & Diagnostic Logging
Click Validate PAT to test token connectivity and inspect permissions:
- Verifies token authenticity against provider API endpoints (
https://api.github.com/userorhttps://api.bitbucket.org/2.0/user). - Displays granted scopes (such as
repoorpublic_repo). - Logs step-by-step diagnostic information, including user account name and HTTP response status codes.
Step 5: Fetch, Preview, and Edit Metadata
Click Fetch Scripts to pull script content into the preview window.
- Tabbed Navigation: Each fetched script opens in its own tab (
Script 1: App.js,Script 2: utils.js). - Monaco Code Editor: Inspect the complete script source code with full syntax highlighting.
- Metadata Editing: Set script metadata before saving:
- Name: Enter a unique descriptive name for the script.
- Category: Assign the script to an organizational category.
- Description: Add notes explaining the script purpose and usage.
- Status: Set the initial state (
ActiveorDraft).
Step 6: Save to Script Hub
- Save Active Script: Click Save Script to import the currently selected tab into your Script Hub library.
- Bulk Import All: Click Save All Scripts to import all fetched scripts simultaneously.
Best Practices for Git Imports
- Use Script Variables for Tokens: Avoid pasting PATs repeatedly. Store your GitHub and Bitbucket PATs in Script Variables for easy reuse and token rotation.
- Organize with Categories: Assign imported scripts to relevant categories (such as
Automation,Workflow Rules, orIntegrations) to keep your library structured. - Set Initial Status to Draft: When importing untested external scripts, save them in
Draftstatus first to review before activating in live automations.