Scenario
Div |
---|
|
Estimated Time: 12 min |
You would like to create an issue and link it with the parent, but do so only in the case where one doesn't already exist.
Background
This scenario uses an example ePub workflow that helps teams coordinate the publication of electronic books. We can add a Create Issue post function that processes when users transition issues from the "In Edit" to "In Composition" steps. This transition can occur multiple times, where users send issues between the two steps. The first time we move between the two steps, a linked issue within another project is automatically created. Therefore, we can inspect each transition and leverage one of Create on Transitions built-in functions to help us check, if the issue already exists. If it does not, we can create and link the issue. Otherwise, we can simply process the transition.
Steps
The following steps demonstrate how to configure Create on Transition, regex inspection of the project using a built-in function:
Table plus |
---|
border | 0 |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
columnAttributes | style="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;" |
---|
id | steps_table |
---|
enableSorting | false |
---|
enableHighlighting | false |
---|
|
| Step 1As a Jira Administrator or Workflow Administrator: - Navigate to your workflow (ePub in this case).
- Edit your ePub workflow to create a draft version.
- Navigate to the Post Functions tab.
- Add a Create Issue post function.
| |
| | Step 2ISSUE FIELDS: - Select the Detailed Fields tab.
- Select the Jira project from the Project field where the new issue is created. In this case, select the "IT Services" project.
- Select the issue type for the new project. In this case, select "Service Request".
- Select the Links tab.
- Select the following from the respective list of available options:
- Create Link - "Original issue key"
- Create link type - "Create on Transition"
- Create link direction - "Issue key to new issue"
| |
| | Step 3OPTIONAL RULES: Configure a condition using the function_linkedIssues substitution variable. - Select the Conditions & Configuration tab.
- Enter "%function_linkedIssues(%original_key%, created by)%" in the Condition 1 field.
- Enter "<Target Project Key>", in this scenario "IS" (project key for the "IT Services project") in the Regular expression pattern field.
- Select Negative matching condition
- Click the Add button to save your changes.
| |
| | Step 4- Remember to publish your workflow. We always recommend saving a backup of the previous workflow when prompted.
- Create an issue and transition the issue to trigger your post function.
- Validate that the new issue was created in the proper project and that it contains a link back to the originating Issue.
- Transition the issue back and then forward to status that triggers your post function.
- Validate that the transition did not create a second new issue within the project.
|
|
|
...