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.
From the Shared extensions page, select the tab for the extension you want to add (e.g. Action for a Shared Action).
Click the Add button to the right of the tabs.
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.
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
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:
Click the add button (e.g. the Add post function button).
A pop-up window will open listing all of the available extensions. Select an extension and click Add.
You will be taken to the configuration screen for the extension. Configure the extension as needed and click Add.
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:
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.
Modify the extension details in the editor screen.
Click Save to save the changes.
When you try to add a Shared Action post-function, Shared Condition, or Shared Validatorwhile 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:
On the Shared extensions page, click the menu icon to the right of the shared action you wish to duplicate. Select Copy.
A new shared extension is created with “Copy of” in front of the original action name. Rename the extension as needed.
Follow the steps in Edit a shared extension above, to make modifications.
Delete a shared extension
To delete a shared extension:
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.
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 Actionpost-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):
Click Edit for the workflow that has the transition.
In the Workflow Designer, select the transition.
Click Post functions in the properties panel.
Click Add post function.
Select Shared Action from the list of post-functions. The Shared Action Post-function configuration screen will open.
Select the appropriate shared action and configure other details as required.
Click Add to add the post-function to the transition.