Script action

Script action

The Script action configuration type will execute a script where the live field has been configured (screens, projects, and issue types). Scripted actions support both JavaScript and TypeScript.

ADF support in Live Fields

Live Fields includes direct support for translating wiki markup to ADF-formatted text when creating output for rich text Jira fields. For example, creating a Live Fields Script action with the following script will create a formatted block of text for the Description field:

getFieldById("description").setValue(` h2.Wiki markup to ADF rich text Programatically set the value of a field, including formatting such as *strong text*, _italics or emphasized text_, and even {color: blue} color text{color}! Additionally, you can create: # A # numbered list #* including a #* nested #* bullet # list See [this page|https://confluence.atlassian.com/docm/latest/confluence-wiki-markup-1108674308.html] for more information. `);

The result of the script above looks like this:

livefield-ScriptedActionADFContent.png

See Wiki text to ADF format for more information on which markups translate to ADF-formatted content.

Note: Not every Wiki markup option is supported for translation to ADF format; neither are all ADF formatting options supported.

livefield-ScriptedAction.png
Figure 1 - Configuration rule builder
livefield-ScriptedActionScriptEditor.png
Figure 2 - Script editor

Add a live fields customization

  1. Follow the steps below to complete your live field configuration.

Configure a Script action

The rule builder (Figure 1, right) is organized in a When-Then setup; the When section details where your configuration will be applied and the Then section contains the actual configurations. Follow the steps above to add a live fields configuration to your Jira instance, then follow these steps:

  1. For Screens, select which screen types should have your configuration applied - Issue create view, Issue view, and/or Issue transition view.

  2. For Projects, select which projects should have your configuration applied.

    1. Click Select projects and check the specific projects, or select Any.

    2. Click Add.

  3. For Issue types, select which issue types should have your configuration applied.

    1. Click Select issue types and check the specific issue types.

    2. Click Add.

  4. Select Scripted action under THEN. Click the Edit button to open the script editor (Figure 2, right).

  5. Enter your script and click Save.

  6. Set the options for your configuration as needed:

    1. On load - Run the Scripted action when one of the selected Jira screens loads.

    2. On change - Run the Scripted action when the value of any field in the selected screens changes.

  7. Click Save.

Note: Use the Templates button in the upper right of the script editor to quickly create a configuration script!

 

Determining custom field IDs

 

Need support? Create a request with our support team.

Copyright © 2005 - 2026 Appfire | All rights reserved.