Create a Linked Issue Post Function
This is the JSU for Jira Server/Data Center documentation. If you are using JSU on Jira Cloud, see our JSU Cloud documentation.
Description
This post function creates a new issue, linked to the origin issue (the one that triggers the post function). Any number of fields can be copied to the new issue and within the origin issue.
See the Testing and Fixing Bugs use case for an example of how some of our customers use this post function.
Configuration
Function Execution Control
Precondition
If you are using preconditions with a JSU post function, you can use the following options to define how the precondition is evaluated:
Ignore precondition (default): Every precondition is ignored which means that the post function will always be performed
True: Precondition must be true to execute a post function
False: Precondition must be false to execute a post function
Learn more about preconditions in Workflow Preconditions.
Custom Field that enables linked issue creation
Select the custom field that enables the creation of the linked issue. For example, you have a ‘Create bug?’ checkbox custom field on the transition screen. If you set this field for this option, the issue will only be created if this checkbox is selected on the transition screen.
Typically this checkbox custom field won't appear on the normal screen of the issue. You can later set them back to the original (default) value (see Copy within the Origin Issue).
Copy or Move Attachments added during the Transition
Instead of allowing a user to choose to copy or move the attachments, you can also configure it to either never or always copy them.
If you select the Move option, it will appear that attachments added on the transition screen of the origin issue were added directly to the new issue.
Mandatory Values for the New Issue
Here you configure the mandatory fields for an issue. Be aware that your Jira configuration might have additional required fields; you should set them with Copy from the Origin Issue to the New Issue.
The Summary will always be copied from the origin issue to the new issue. The reporter of the new issue will always be set to the user who triggered the current transition (and therefore this post function). However, you could overwrite them again later with Copy from the Origin Issue to the New Issue
Target Project
You can set the target project to:
Inside same project: A new issue will be created in this same project
Project variables: If you use the workflow with the 'Create a Linked Issue' post function in several Jira projects, you might choose 'Project variables'. You then can configure in each of those Jira projects a different target project for the newly created issues. See Project Variables to learn more.
The format of the project variables is:createLinkedIssueTargetProjectKey.<Workflow Name>.<Workflow Transition Nummer>=<Projekt Key>
Workflow Name and Workflow Transition Number are optional.
Example
From project A, you might create new linked issues in project X. But from project B, you might create new linked issues in project Y. But both use the same workflow.
Project Variable in project A: createLinkedIssueTargetProjectKey=X
Project Variable in project B: createLinkedIssueTargetProjectKey=Y
The new issue will be created with the same user who triggered the transition on the origin issue. If that user does not have the necessary permissions in the target project they will encounter an error. Similarly, if some validators prevent the creation of the new issue.
Selected Project:
A new issue will be created in the selected projectDefined by custom field selection:
A new issue will be created in a project defined in the selected custom field. Available fields of types: single select, radio buttons, project pickers
Example
You can create a field "Destination Project" with several different values which will represent the project key (only capital letters) or project name (capital and small letters are supported).
Create New Issue as User
If you do not specify a user, the create operation will be performed under the same user who triggered this post function on the origin issue. That user must have the necessary permissions to create the new issue. In some restrictive setups, the user might not be allowed to create new issues in the target project; they might not even see the target project.
With 'Create New Issue as User' you can specify a different user account that owns the necessary permissions. Usually, this user account is assumed to be only technical, with broad permissions, but not used to log into Jira for normal activity.
This Issue will be related via
The Create a Linked Issue post function allows you the create new issues that are connected not only with an issue link but also in a parent / subtask, as well as epic / issue in epic relation.
See Related Issues for more details.
Issue Type
Issue type can be set to:
Selected issue type: A new issue type will have a particular issue type. The issue type you configure here must be available in the target project.
Defined by custom field selection: Similar to Target Project, an issue type can be defined by the value selected by the user in a dedicated custom field. The issue type you provide in this custom field must be available in the target project.
A user can select which issue type should be created. As a Jira administrator, you must create this custom field, for example, Destination Issue Type. Carefully note the values of this custom field. These values have to match the issue types available in the target project.
Configure fields
With JSU’s Create Linked Issue post function, you can define configurations to modify fields on the origin and new issue.
Definition of terms for the configure fields objects
Origin issue: Issue that triggered the post function
New issue: Issue to be created by the post function that was triggered on the origin issue
Choose your field configuration
Click Add Configuration and select the operation you want to execute. The following operations are available:
Organizing operations
You can configure any number of configurations. They are executed sequentially. You can rearrange the configurations by dragging the handle on the left.
You can also disable a configuration by unchecking the enabled flag next to the Delete button. Your operation will remain on your configuration but will be ignored.
Example
Let's say you are a Hiring Manager and onboarding a new Marketing Assistant.
Your tasks to complete the onboarding would then include:
Create new contract
Order new computer
First, you create your origin issue which you’ll call Hiring a Marketing Assistant. Instead of manually creating linked issues and copying/setting field values, JSU’s New Set of Operations can help automate these tasks.
On adding the "Create Linked Issue" post-function to the "In progress" transition, configure the fields you prefer with the help of the three New JSU operations:
Copy a field value from the origin issue to a new linked issue
Copy the value from one field to another field within the origin issue, and
Set the value of a field in a new linked issue
First, you can copy a field from the origin to the new issue. Let's copy the assignee of the task to the assignee of the subtask. Then, you can copy a value from a field of the origin issue to another field of the origin issue. We'll try it by copying the summary to the description and prepending it with a dash. Configure the last operation by setting a value for the summary of the new issue. We'll set it to "Create contract"
When you have completed your configuration, click Add at the bottom of the page. You can do the same for as many sub-tasks as you want to have automatically created. Finally, publish your workflow and go back to your issue. Move the issue to in progress and see how JSU applies the operations.
Position of the post function
‘Create’ transition
If you use this post function in the ‘Create’ transition, position it after Jira’s ‘Creates the issue originally’ post function and before ‘Re-index an issue to keep indexes in sync with the database.’
You can’t use Copy and/or move attachments added during Transition or Copy field within the same issue features for the ‘Create’ transition.
Any other transition (not 'Create)
If you use 'Move Attachment added during Transition' you must position the post function before 'Update change history for an issue and store the issue in the database.'
You can add this post function several times in one transition.
Example
See the Use Case Testing and Fixing Bugs for an example of how some of our customers use it.