Skip to main content

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 https URL. Script Master fetches it from Atlassian's cloud, not from your computer, so localhost and private network addresses don't work. A common setup is a local web server with a tunnel that gives it a public https address.
  • 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.
warning

Anyone who knows the URL can read the file while it's public. Don't put tokens or passwords in it.

Connect a file​

  1. Open the item's editor, or the Script Console.

  2. Above the code, select External. In the Script Console, select Use External Editor. The Use an external editor with live reloading panel opens.

  3. Paste the URL of your file, for example https://scripts.example.com/weekly-report.js.

    The Use an external editor with live reloading panel with a file URL entered, and the Connect and Close buttons

  4. 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.

    warning

    The file's code replaces the code in the editor.

  5. Optionally, turn on Autosave to save the item each time the file changes.

  6. 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​

  1. Select Disconnect. The editor becomes editable again and keeps the last code it loaded.
  2. Select Close to hide the panel.

If the file doesn't load​

MessageWhat to do
Link should not be emptyPaste the file's URL before you select Connect.
Link must be an https URL pointing at a publicly reachable hostUse 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.