# Oktul Code Studio

> Write, store and run JavaScript and TypeScript scripts in Jira and Confluence Cloud on Atlassian Forge, with a sandbox that lists every change first.
>
> Documentation for Oktul Code Studio, for Jira Cloud and Confluence Cloud, by Oktul: https://oktul.com/docs/plugins/code-studio/

Oktul Code Studio stores, edits and runs **JavaScript and TypeScript** scripts in Jira and
Confluence Cloud, with **AssemblyScript** compiled to WebAssembly for heavy computation. Every
script runs on Atlassian Forge, inside your own site: Oktul runs no server and receives none of
your data.

## Two listings, one installation

Code Studio is sold as two Marketplace apps built from one source:

| Listing | Requires | Can connect |
|---|---|---|
| **Oktul Code Studio for Jira** | Jira | Confluence |
| **Oktul Code Studio for Confluence** | Confluence | Jira |

A site installs one of them.

- **Connect the other product** to the same installation and one set of scripts reaches both.
- **The console opens only in the required product.** The other feeds events, is reached by
  scripts and has the administration page.
- **Two installations, one of each, do not share scripts.**

## What it does

- **Runs a script from the console, a product event, a schedule, a Jira automation rule or an
  HTTP request**, all through one path. See [triggers](./triggers/).
- **Shows a change before it is made.** In the [sandbox](./sandbox-and-production/) a script
  reads the site for real, and every write is listed instead of sent.
- **Runs about an hour.** A run continues itself past Forge's 900-second limit, at most three
  times, and can be stopped by a person at any moment.
- **Reaches other systems through connections.** A credential is added after the script built
  the request, so the script never sees it. See [connections and variables](./connections-and-variables/).
- **Converts ScriptRunner Groovy.** A Rovo agent writes the TypeScript version as a draft. See
  [Groovy migration](./groovy-migration/).
- **Computes Jira fields and drives forms.** Scripted fields and dynamic forms are built on
  console scripts. See [fields and forms](./fields-and-forms/).

## What it does not do

- **It does not run Groovy.** Groovy files are imported for conversion only.
- **It does not recreate ScriptRunner's HAPI.** The translator maps each HAPI call to the REST
  call it makes.
- **It does not guarantee a production run matches its sandbox run.** The site can change between
  the two, and a script that reads time or randomness can take another path.
- **It cannot stop a script that only computes at once.** A script that awaits a request stops
  within 5 seconds; a tight loop with no `await` stops when its invocation ends. See
  [limits](./limits/).
- **It is in English only.** There is no Data Center or Server version.

## Common questions

**Which languages does Code Studio run?**

JavaScript and TypeScript, with AssemblyScript compiled to WebAssembly for heavy computation. Groovy is converted to TypeScript by a Rovo agent, never run.

**Does Code Studio send data to Oktul?**

No. Every script runs on Atlassian Forge inside your site. Oktul runs no server and receives none of your data.

**Can I try a script without changing anything?**

Yes. In the [sandbox](./sandbox-and-production/) a script reads the site for real and every write is listed instead of sent.

**How long can a script run?**

About an hour. A run continues itself past Forge's 900-second limit, at most three times, and a person can stop it at any moment.

**Do I need both the Jira and the Confluence listing?**

No. Install one and connect the other product to the same installation, so one set of scripts reaches both.

**Can Code Studio call systems outside Atlassian?**

Yes, through a [connection](./connections-and-variables/) that holds the credential, or straight to a host an administrator approved.

## Where to start

| If you are | Start with |
|---|---|
| The administrator installing it | [Install the app](./install/), then [administration](./configure/) |
| Writing scripts | [Scripts](./scripts/), then [sandbox and production](./sandbox-and-production/) |
| Moving from ScriptRunner | [Groovy migration](./groovy-migration/) |
| Reviewing it for security or procurement | [Security](./security/) and [privacy and data handling](./privacy/) |

---

A problem or a question? Write to [support@oktul.com](mailto:support@oktul.com) or open a request in the [Help Center](https://oktul.atlassian.net/servicedesk/customer/portals). Both open a request with a reference and an SLA.
