Skip to main content

Create a fragment

Create a fragment to add your own panel, action or page to Jira or Confluence. You write the code, check it in the live preview, then turn it on for the people who use that location.

Applies to: Script Master for Jira and Script Master for Confluence Β· Cloud

Before you begin​

  • Jira or Confluence permission: Jira admin (the Administer Jira global permission) or Confluence admin. Only admins can open Script Master.
  • App permission: an active Script Master license. Without one, you can't create fragments.
  • The site has fewer than 100 fragments.

Open the editor​

  1. In Script Master, open the Fragments tab. On a narrow window it can sit under More.

  2. Choose how to start:

    • Select Create fragment for an empty editor.
    • Select the arrow next to Create fragment (More ways to create) > From a template to start from a working example.
    • Select the arrow > Import to paste a fragment exported from another site. See Import, export and duplicate.

    Before the first fragment, the tab shows Create fragment, From a template and Import as separate buttons.

  3. If you picked From a template, the Start from a template dialog opens. Select a template.

    The Start from a template dialog for Jira, with Display contributors, Display assignee changes, Delete all work item links and Embed a YouTube video

    The editor opens with the template's title, description, location and code filled in.

Templates​

TemplateLocationWhat it does
Display contributorsWork item panelLists everyone who has edited this work item
Display assignee changesWork item panelShows every change of assignee on this work item
Delete all work item linksWork item actionRemoves every link from the current work item. It can't be undone
Embed a YouTube videoWork item panelA video that follows the dark theme and resizes itself

Fill in the fragment​

  1. In Title, enter the name people see in the fragment list. Up to 128 characters.

    The fragment editor with Title, Location, Description and Spaces above the code, and the live preview beside the code

  2. In Location, select where the fragment shows. A new fragment starts on Work item panel in Jira and Page byline item in Confluence. See Where fragments can show.

  3. In Description, say who the fragment is for and what it does. People see it under the title. Up to 256 characters.

  4. In Spaces, select the spaces where the fragment shows. Leave it empty to show it in every space. In Confluence, search with the exact space key.

  5. In Frontend HTML + JavaScript, write the fragment's code. Put JavaScript in <script> tags. See Write fragment code.

  6. Check the result in the Preview beside the code. See Preview your code.

Title, Description and the code are required. If one is empty when you save, it's marked This field is required and nothing is saved.

Save and turn it on​

  1. Select Save, or press Ctrl+S (Cmd+S on a Mac). To add a note to this version, select the arrow next to Save > Save with note….
  2. Turn on Enable at the top of the editor.
  3. Select Save again.

Result: Script Master shows "Fragment saved!" with the version number. The fragment shows in its location for people in the chosen spaces.

You can also switch a fragment on or off from the list, with the switch in its Status column.

Change or remove a fragment​

In the Fragments tab, select the fragment's name to open it in the editor. Each row's β€’β€’β€’ menu also has Version history…, Turn on or Turn off, Duplicate, Export and Delete….

To delete a fragment:

  1. In the fragment's row, select β€’β€’β€’ > Delete….

  2. Select Delete to confirm.

    warning

    Deleting can't be undone. The fragment stops showing at once, and its failure record and version history go with it. Export it first if you might need it again.

Result: Script Master shows that the fragment was deleted, and it's gone from the list.