Canarys HAPI Reference Overview
Welcome to the Canarys High-Level Abstraction Programming Interfaces (HAPI) reference documentation. Canarys HAPI provides user-friendly, named JavaScript/TypeScript APIs designed specifically for the Jira Forge Script Console, allowing you to automate workflows, manage projects, and interact with external systems without writing verbose boilerplate code.
We provide dedicated HAPI wrappers for two primary platforms: JIRA and GITHUB.
JIRA HAPI vs. GITHUB HAPI
| Platform | Object Prefix | Implemented Functions | Authentication / Setup | Key Modules |
|---|---|---|---|---|
| Canarys HAPI: JIRA | WorkItems, Spaces, Users, Groups |
52 functions | Auto-Authenticated Runs within the Forge App Context under app/user permissions. |
Issues, Projects, Groups, User Profiles, Entity Properties. |
| Canarys HAPI: GITHUB | git.*, requestGitHub |
88 functions | Token Configuration Required Requires a GitHub Personal Access Token (PAT). |
Repositories, Issues, Pull Requests, Branches, Actions, Webhooks, File Contents. |
Configuring GitHub Token
To execute GitHub HAPI scripts in the console, you must configure a GitHub Personal Access Token (PAT). You can configure this in two ways:
1. Securely via Script Variables (Recommended)
This is the safest method as it keeps your credentials hidden and encrypted.
- Navigate to Apps → ScriptFabric → Script Variables in Jira.
- Click Create Variable and enter:
- Key:
GITHUB_TOKEN(must be exactly this case) - Value: Your GitHub Personal Access Token (PAT).
- Scope:
global - Encrypt: Enabled (stores the value fully encrypted)
- Key:
- Click Save. The GitHub HAPI layer will automatically fetch and decrypt this variable at runtime.
2. Dynamically in Code (Override)
If you want to use a specific token for a single script run, you can set it directly at the top of your script using git.token:
// Override the token for this run
git.token = "ghp_your_temporary_token_here";
// Run your API calls
const repo = await git.getRepo("owner", "repo");
return repo;
Detailed References
Select a sub-section in the sidebar to explore the full code examples and guides:
- Canarys HAPI: JIRA — Detailed reference for all 52 Jira HAPI methods.
- Canarys HAPI: GITHUB — Comprehensive reference and code examples for all 88 GitHub HAPI methods.