Configuration details
Add the following details to configure the post-function to fit your scenario:
Shared action
Select the shared actions action to be run. The list of shared actions displayed here is defined in Shared extensions.
Target issues
Which issues: Select the issue(s) on which the selected shared action is run. Select one of the following:
Current Issue : - Select this option to perform the post-function on the current issue. This is the default option.
Sub-tasks of the current issue : - Select this option to perform the post-function on the sub-tasks of the current issue.
Parent issue of the current sub-task: - Select this option to perform the post-function on the parent of the current issue.
Issues that belong to the current Epic: - Select this option to perform the post-function on the issues that belong to the current Epic.
Epic of the current issue: - Select this option to perform the post-function on the Epic of the current issue.
Child issues of the current issue in the Portfolio hierarchy: - Select this option to perform the post-function on the child issues of the current issue in the Portfolio hierarchy.
Parent issue of the current issue in the Portfolio hierarchy: - Select this option to perform the post-function on the parent issues of the current issue in the Portfolio hierarchy.
Issues linked to the current issue through any link type: - Select this option to perform the post-function on all issues linked to the current issue no matter the link type.
Issues linked to the current issue through the following link type : -Select this option to perform the post-function on the issues linked to the current issue through a specific link type. Select the specific link type under Issue link, which will appear when this option is chosen.
Issues returned by the following Groovy script: - Input a Groovy script that returns either:
a single Issue object
a Collection of Issue objects
a String representing the key of an issue
a Collection of Strings each representing an issue key.
For example:"TEST-1"
["TEST-1","TEST-2"]
ComponentAccessor.issueManager.getIssueObject("TEST-1")
[ComponentAccessor.issueManager.getIssueObject("TEST-1"),ComponentAccessor.issueManager.getIssueObject("TEST-2")]
issue.parentObject
issue.getLinkedIssues()
For more information, refer to Groovy editor in JMWE and Groovy script tester in JMWE.
Issues returned by the following JQL search: - Input a JQL search expression, including an optional Groovy Template markup. For example:
project = TEST
returns issues of the project with the key TESTproject = ${issue.get("project").key} and assignee = ${currentUser.name}
returns issues of the project the current issue belongs to and assigned to the current user.To operate on issues of a project with key
TEST
and issue type name same as the value in a text fieldCode Block <% if (issue.get("Single line text")) { %> project = TEST and issuetype = ${issue.get("Single line text")} <% } else { %> issuekey=INVALID-1 <% } %>
Note |
---|
|
Conditional execution
Only if the condition is true: Select this option to run the post-function only when the entered expression is true.
Enter a Groovy script that returns true when the post-function should run. For more information, refer to Conditional execution using Groovy script.
Error Handling
Make transition fail when an error occurs in this post-function: Select this option to make the transition fail when an error occurs while running the post-function. An error message is displayed to the user showing the transition failure.
Example
Scenario: You want to create a testing task every time a development task with Priority set to ‘Major’ is transitioned to the stage Closed, and then assign the new issue to a testing team member.
Perform the following:
Step 1.Create a new Shared extension.Click the Administration button in the upper right corner and select Manage apps.
Under JIRA MISC WORKFLOW EXTENSIONS click Shared extensions.
Click the Actions tab.
Click Add shared action to the right of the tabs.
Add the following:
Action name: Enter a meaningful name for the action.
Description: Enter a more detailed explanation of what the action would accomplish.
Post-functions: To add post-functions:
Click Add action.
Select Create / Clone issue(s) from the list of post-functions and click Add.
Since you want to create a testing task for a development task with
Priority
set to Major
, select the Only if the condition is true optionand add return (issue.get("priority").getName() == "Major")
to the Condition field. Click Add to add the post-function to the action.
Repeat Steps i through iv using:
the Assign to role member post-function in step ii, and
assigning a Project Role to the intended project role member (Testing role member in this scenario) in step iii.
All of these post-functions will be run in sequence.
Click Save and the newly created action is added to the Shared actions list.
Step 2. Add the Shared Action post-function to the workflow transition.
Click Edit for the workflow that has the transition to which the shared action should be added.
In the Workflow Designer:
If viewing the workflow as Text, click the name of the transition and click the Post-functions tab.
If viewing as a diagram, select the transition and 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 window will open.
Select the newly created shared action you created in Step 1.
Click Add to add the post-function to the transition.
Include Page | ||||
---|---|---|---|---|
|
Error Handling
Include Page | ||||
---|---|---|---|---|
|