Shared Extensions

Shared extensions allow you to create extensions (Post-functions, Conditions, and Validators) that run a sequence of extensions in order; the shared extensions can then be added to multiple workflow transitions. In essence, the shared extensions feature enables you to create an extension once and then use them almost anywhere. This helps maintain the most common configurations, making changes far simpler by enabling updates in one location that then apply to all transitions that utilize the extension.

As of JMWE 8.4.0, it is also possible to add conditions and validators from other Jira apps to a JMWE Shared Extension, including Jira native conditions and validators. Numerous other third-party conditions and validators can also be added, greatly expanding the capabilities of Shared Extensions!

The Shared extensions page (pictured, right) includes tabs for each of the extension types - Post-functions, Conditions, and Validators. Each tab lists all the existing extensions and displays a link to view where each shared action is currently used.

A shared extension can be used in:

To open the Shared extensions page:

  1. Log in to your JIRA Server instance as an administrator.

  2. Click on the Administration icon in the upper right corner.

  3. Select Manage Apps.

  4. Locate JIRA MISC WORKFLOW EXTENSIONS in the left panel and select Shared extensions.

Figure 1 - Shared Extensions


Add a shared extension

To add a shared extension:

  1. From the Shared extensions page, select the tab for the extension you want to add (e.g. Action for a Shared Action).

  2. Click the Add button to the right of the tabs.

  3. An editor window will open (for example, the Shared action editor, pictured right). The editor for each of the extension types is nearly identical. The fields available are:

    • Name: Enter a name for the extension.

    • Description: Enter a more detailed explanation of what the extension would accomplish.

    • Post-functions or Conditions or Validators: The last section of the editor enables you to add a sequence of extensions to the shared extension. For more information on using the editor, see Extensions editor, below.

  4. Click Save.

Note: It is not possible to add a Shared Extension to itself as it causes an infinite loop. The Shared Extension calls itself, which calls itself again, and so on indefinitely. To avoid creating an infinite loop, you will either be unable to add Shared Extensions to themselves when editing them, or you will get an ‘Infinite loop detected’ error message when trying to save a Shared Extension.

Figure 2 - Shared Action Editor


Extensions editor

The extension editor is where you create the sequence of extensions that will be executed when the shared extension is triggered. To add an extension:

  1. Click the add button (e.g. the Add post function button).

  2. A pop-up window will open listing all of the available extensions. Select an extension and click Add.

  3. You will be taken to the configuration screen for the extension. Configure the extension as needed and click Add.

  4. The Shared extension page will open, with the newly-added extension listed (pictured, right, under Post functions).

Within the editor, existing can be reordered, modified, or removed.

  • Click-and-drag on the move icon and release to reorder the extension.

  • Click Edit to open the extension configuration page.

  • Click Remove to remove the extension.

Edit a shared extension

To edit an existing shared extension:

  1. From the extension’s tab, click the menu button next the shared extension you wish to modify and select Edit. The editor (pictured above, right) will open.

  2. Modify the extension details in the editor screen.

  3. Click Save to save the changes.

When you try to add a Shared Action post-function, Shared Condition, or Shared Validator while editing a shared extension, you’ll notice that the shared extension you are currently editing is disabled for selection. This is to avoid creating an infinite loop by adding the shared extension to itself.

Copy a shared extension

Sometimes it is easier to create a new shared extension based on one that already exists. To copy a shared extension:

  1. On the Shared extensions page, click the menu icon to the right of the shared action you wish to duplicate. Select Copy.

  2. A new shared extension is created with “Copy of” in front of the original action name. Rename the extension as needed.

  3. Follow the steps in Edit a shared extension above, to make modifications.

Delete a shared extension

To delete a shared extension:

  1. On the Shared extensions page, click the menu icon next to the shared extension you wish to delete and select Delete to remove the shared extension permanently.

  2. Click OK in the confirmation dialog to confirm.

Please note: the Delete option is disabled when the shared extension is used in:

The shared extension needs to be removed from all of the above before it can be deleted.

Figure 3 - Shared Action Example


Example: use a shared action in a workflow

You can use a shared action in a Jira workflow by using the Shared Action post-function. When added to a transition, this post-function lists all the shared actions configured in the Shared extensions page, allowing a workflow administrator to select one action and run it during the specified transition.

For example, say you have configured several actions in the Shared actions page (Figure 1, above right).

To add one of these shared actions to a transition (using the Shared action post-function):

  1. Click Edit for the workflow that has the transition.

  2. In the Workflow Designer, select the transition.

  3. Click Post functions in the properties panel.

  4. Click Add post function.

  5. Select Shared Action from the list of post-functions. The Shared Action Post-function configuration screen will open.

  6. Select the appropriate shared action and configure other details as required.

  7. Click Add to add the post-function to the transition.

  8. Publish the workflow.