Edit in an external editor
Write a script in your own editor, such as Visual Studio Code, and Script Master loads every change into its editor. Script Master reads the file from a URL every 3 seconds while you're connected.
This works in the Script Console and in the editors of fragments, gadgets, macros, web triggers and scheduled jobs.
Before you beginβ
- You need the Administer Jira global permission, or Confluence administrator rights.
- Your file must be reachable on the internet at an
httpsURL. Script Master fetches it from Atlassian's cloud, not from your computer, solocalhostand private network addresses don't work. A common setup is a local web server with a tunnel that gives it a publichttpsaddress. - The URL must use the standard port (443) and carry no user name or password.
- Script Master reads up to 2 MB of the file.
Anyone who knows the URL can read the file while it's public. Don't put tokens or passwords in it.
Connect a fileβ
-
Open the item's editor, or the Script Console.
-
Above the code, select External. In the Script Console, select Use External Editor. The Use an external editor with live reloading panel opens.
-
Paste the URL of your file, for example
https://scripts.example.com/weekly-report.js.
-
Select Connect. The button changes to Connected!, with Disconnect and an Autosave switch next to it. Below the field, Watching for updates... and Updated: show the time of the last load.
warningThe file's code replaces the code in the editor.
-
Optionally, turn on Autosave to save the item each time the file changes.
-
Edit the file in your editor and save it there.
Result: Within about 3 seconds, the Script Master editor shows your change and Updated: shows the time. While you're connected, the Script Master editor is read-only.
To test the script, run or preview it in Script Master as usual. Without Autosave, select Save in Script Master to save the item.
In the Script Console, Autosave keeps the script in this browser, as the save shortcut does there. In the scheduled job editor, Autosave doesn't save: select Save.
Disconnectβ
- Select Disconnect. The editor becomes editable again and keeps the last code it loaded.
- Select Close to hide the panel.
If the file doesn't loadβ
| Message | What to do |
|---|---|
Link should not be empty | Paste the file's URL before you select Connect. |
Link must be an https URL pointing at a publicly reachable host | Use an https URL on a public host and the standard port, with no user name or password. |
Error getting the content by URL, but we will try to reconnect... | The file couldn't be read, for example 404 (Not Found). Check that your server and tunnel are running and that the URL opens in a browser. Script Master keeps trying every 3 seconds. |
Relatedβ
- Code editor: editor features and shortcuts.
- Build a script with AI: start from a prompt about each module's API.
- Version history: every save, including autosaves, is a version you can restore.