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. Shared extensions enable 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 Shared extension.
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 (Figure 1, 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:
Other shared extensions
To open the Shared extensions page:
Log in to your JIRA Server instance as an administrator.
Click on the Administration icon in the upper right corner.
Select Manage Apps.
Locate JIRA MISC WORKFLOW EXTENSIONS in the left panel and select Shared extensions.
Note: Within JMWE for Jira Data Center, there is a distinction between a Shared extension and a Shared action. A Shared Extension is a shared among multiple transitions and is managed through the JMWE Administration page. A Shared action is a type of Shared Extension that contains post functions, and is added to transitions using the Shared action post function.
You are viewing the documentation for Jira Data Center.
Add a Shared Extension
To add a shared extension:
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 (e.g. Add shared condition for Conditions).
An editor window will open (for example, the Shared action editor, Figure 2, 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.
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.
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 a post function, condition, or validator (depending on the type of Shared 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 extensions can be reordered, enabled or disabled, 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 the Enable/Disable toggle to enable or disable the extension.
Click Remove to remove the extension.
In addition to the tools above, the Extension editor includes execution log information, including the last time the extension executed, and status information for the last several executions.
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.
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.
Use a Shared Extension 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):
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.
Publish the workflow.