...
...
...
...
...
...
...
This page allows you to create actions with one or more post-functions that can be used in the Shared Action post-function
...
. The page also lists the workflow transitions where the Shared action is being used. This feature can be used to
...
share the configuration of a single post-function, or of a sequence of post-functions, between multiple transitions and workflows,
...
thereby greatly simplifying the maintenance of your workflows.
On this page:
Table of Contents |
---|
Create an Action
To create a sequence:
Navigate to the Jira Settings → Apps → Shared actions
Click on "Shared actions"
Click on "New shared action"
Add a name and an optional description
Click on "Add post-function"
Select a post-function
Click on “Add”
Configure the post-function and click on “Save”
Click on “Save”
Edit an action
You can edit the action details and edit/reorder/delete the post-functions of an action.
Edit an action details
Click on “Edit” for the action
Modify the action details
Click on “Save”
Edit a post-function in an action
Click on “Edit” for the action
Click on “Edit” for the specific post-function
Modify the post-function
Click on “Save”
Click on “Save”
Reorder the post-function sequence in an action
Click on “Edit” for the action
Drag the ☰ handle and reorder the post-functions
Click on “Save”
Click on “Save”
Delete a post-function in an action
Click on “Edit” for the action
Click on “Remove” for the post-function
Click on “Save”
Delete an action
Note |
---|
...
You cannot delete a Shared action when it is referenced in any Shared Action post-function. |
...
You need to remove the references to delete the Shared Action. |
Click on “Delete” for the action
Click on “OK”
The sequence is deleted.
Passing variables within a sequence
Using the {% setContextVar %}
Nunjucks tag, you can pass data from one post-function to its subsequent post-functions.
...
context: Holds all the context variables added in the current post-function. For example, if you create a context variable
myVar
in the first post-function of the sequence:Code Block language js
...
{% setContextVar myVar = "a value" %}
This variable will then be available to subsequent post-functions as:
Code Block language js
...
{{
...
context.myVar }}
Note that this variable will not be available in the Nunjucks tester.
Variables specific to the Create Issue post-function
newIssueKey:
Stores the issue key of the last issue created by a Create Issue(s) post-function in the action. You can access it as:Code Block language js
...
{{
...
context.newIssueKey }}
newIssueKeys:
Stores an array of the keys of all the issues created by any Create Issue(s) post-function in the action. You can access the created issues fromCode Block language js
...
...
{{
...
context.newIssueKeys }}
For example: to add a comment on the current issue with the keys of the issue created
Code Block language js
...
Issues created are: {{
...
context.newIssueKeys | join(",") }}
You can access the information of a specific issue using the issue filter. For example: To get the assignee of the issue created by the Create issue post-function
Code Block | ||
---|---|---|
|
...
{{ |
...
context.newIssueKey | issue("assignee") | field("fields.assignee.displayName") }} |