-
Notifications
You must be signed in to change notification settings - Fork 0
USER_GUIDE
Last Updated: June 4, 2026
SmartScript for Jira is a Forge-native automation app for Jira Cloud. It lets Jira administrators create, test, and manage JavaScript automations with a Monaco editor, reusable templates, sandboxed execution, and execution logs.
- Install SmartScript for Jira from the Atlassian Marketplace.
- Approve the requested Jira scopes.
- Open Jira and go to Settings → Apps → SmartScript-Jira.
Only Jira administrators can use the app. Non-admin users will see an access denied message.
| Concept | Description |
|---|---|
| Script | A saved automation containing JavaScript code, metadata, trigger type, and active state. |
| Trigger | The Jira or scheduled event that runs a script. |
| Template | A prebuilt script generator with editable parameters. |
| Manual Run | A sandbox test run from the editor using mock event data. |
| Execution Log | A recent script run record with status, duration, issue key, and output/error details. |
SmartScript currently supports:
-
Issue Created (
issue_created) -
Issue Updated (
issue_updated) -
Issue Transitioned (
issue_transitioned) -
Attachment Added (
attachment_added) -
Scheduled Run (
scheduled_run) -
Manual (
manual)
Jira Cloud does not reliably fire a comment_created Forge event for this app, so comment-created triggers are not supported.
Scheduled scripts use a five-field UTC cron expression stored on the script. The Forge scheduled trigger runs hourly, and SmartScript checks whether each script's schedule matches the current hour.
Supported cron syntax:
**/NN,M- plain numbers
Ranges such as 1-5 are not supported. Use 1,2,3,4,5 instead.
- Click Create New Script.
- Enter a script name.
- Select a trigger type.
- Optionally enter comma-separated Jira project keys in Project Scope.
- Write ES5 JavaScript in the editor or load a template.
- Toggle Active on when ready.
- Click Save Changes.
Inactive scripts are saved but skipped by live triggers. Manual Run still works for testing.
For event-based scripts, Project Scope limits execution to the listed Jira projects. The field shows e.g. PROJ, MYAPP (leave empty for all projects) and the guidance Leave empty to apply to all projects. Leaving it empty applies the script to every project.
The app includes these built-in templates:
| Template | Trigger |
|---|---|
| Auto-assign by Component | Issue Created |
| Add Comment on High Priority | Issue Created |
| Auto-label by Summary | Issue Created |
| Comment on Done Transition | Issue Updated |
| Transition on Attachment Upload | Attachment Added |
| Daily Overdue Issue Alert | Scheduled Run |
| Alert on Unassigned Issue | Issue Updated |
| Alert on Priority Change | Issue Updated |
| Comment on Work Started | Issue Updated |
| Stale Issue Nudge | Scheduled Run |
| Create QA Subtask on Done | Issue Transitioned |
| Create Bug Triage Subtasks | Issue Created |
| Create Release Checklist for High Priority | Issue Created |
| Add Watcher by Component | Issue Created |
| Add Watcher on Priority Escalation | Issue Updated |
| Link Mentioned Issue from Summary | Issue Created |
| Label Stale Bugs | Scheduled Run |
| Transition Overdue Issues | Scheduled Run |
| Comment on Attachment Upload | Attachment Added |
| Add Label on Attachment Upload | Attachment Added |
To use a template:
- Select or create a script.
- Click Load Template.
- Choose a template.
- Fill in the parameters.
- Click Apply Template.
- Review the generated code and click Save Changes.
Template parameters are inserted into JavaScript string literals. Avoid storing secrets or sensitive data in template fields.
Scripts run in an ES5-only JavaScript sandbox. Use var, traditional function callbacks, string concatenation, and simple loops.
Avoid:
-
const/let - arrow functions
- template literals
-
async/await Promise-
import/require -
fetch,XMLHttpRequest, timers, filesystem access, or arbitrary network calls
Scripts can access only the following globals:
| Global | Signature / usage |
|---|---|
event |
Forge event or scheduled/mock event payload. |
console.log |
console.log(value) writes to execution logs. |
getIssue |
getIssue(key, callback) |
updateIssue |
updateIssue(key, jsonBody, callback) |
addComment |
addComment(key, text, callback) |
setAssignee |
setAssignee(key, accountIdOrEmail, callback) |
transitionIssue |
transitionIssue(key, transitionId, callback) |
createSubtask |
createSubtask(parentKey, dataJson, callback) |
getUser |
getUser(accountId, callback) |
addWatcher |
addWatcher(key, accountId, callback) |
linkIssues |
linkIssues(inwardKey, outwardKey, linkType, callback) |
searchIssues |
searchIssues(jql, callback) |
Callbacks return an object such as { status: 200 } on success or { error: "message" } on failure. searchIssues returns up to 50 matching issues.
var issue = event.issue;
var priority = issue.fields && issue.fields.priority ? issue.fields.priority.name : "";
if (priority === "Highest") {
addComment(issue.key, "This issue needs immediate attention.", function(res) {
console.log("Comment result: " + res.status);
});
}Click Run to execute the current script in a mock sandbox. SmartScript injects mock event data based on the selected trigger type, such as issue-created, issue-updated, issue-transitioned, attachment-added, scheduled, or manual test data.
In sandbox mode:
- Jira helper functions do not modify real Jira data.
- Helper functions log mock API calls and return successful mock responses.
- Results and
console.logoutput appear in the execution result panel.
Manual Run is useful for syntax and control-flow checks. Always test important automations on a non-production Jira project before enabling them broadly.
Open the Execution Logs tab to view recent script runs.
Logs include:
- Time
- Script name
- Trigger type
- Issue key when applicable
- Success or error status
- Duration
- Result, error, or
console.logoutput
Logs are capped to the most recent 50 records. Use Clear All to delete current logs.
SmartScript requests these Atlassian scopes:
| Scope | Purpose |
|---|---|
read:jira-work |
Read issue data for triggers and helper functions. |
write:jira-work |
Update issues, add comments, transition issues, create subtasks, add watchers, and link issues. |
read:jira-user |
Resolve or read Jira user details for assignment-related helpers. |
storage:app |
Store scripts and execution logs in Forge storage. |
- The app is hosted on Atlassian Forge.
- JMC Labs does not operate external app servers or databases for SmartScript.
- The app does not use Google Analytics, Segment, Mixpanel, Sentry, or similar third-party tracking tools.
- Scripts and logs are stored in Forge storage.
- Logs may contain Jira data if your scripts write such data with
console.log. - Do not store passwords, Personal Access Tokens, API keys, or shared secrets in scripts or logs.
- Scripts must be ES5-compatible.
- Long-running scripts are constrained by Forge function runtime limits.
- Scheduled checks run hourly.
- Execution logs retain only the most recent 50 records.
- Comment-created triggers are not supported.
- The app does not provide arbitrary outbound HTTP access from user scripts.
- Confirm the script is Active.
- Confirm the selected trigger matches the Jira event.
- Confirm the app has been upgraded after any scope or manifest changes.
- Check the Execution Logs tab.
The script likely uses modern JavaScript. Replace let, const, arrow functions, template literals, async, or await with ES5-compatible syntax.
The request body or transition ID is probably invalid for that Jira project. Check the Jira REST API shape and project workflow configuration.
The app or acting context lacks permission for the action. Check Jira permissions, app scopes, issue security, and whether the site admin approved the latest app version.
Manual Run uses mock data and does not call real Jira APIs. Test live behavior on a safe Jira project before relying on production automations.
For support or security questions, contact:
JMC Labs
Email: wjdals9058@gmail.com