2 minutes reading time
How to skip validation when cloning an issue
This solution was provided by Joy Melendez. It has earned a $100 donation to FIRST.
A JMWE validator is being used during the issue creation step. It validates that the issue has a certain linktype associated with it. The validator works properly when issues are being created. However, it doesn't work when a user clones an issue in Jira UI - even if the 'clone links' option is selected.
The need for validating a workflow transition might vary depending on whether you are creating a new issue or cloning one. The good news is that you can easily skip the validation when cloning an issue. Just follow the easy steps below.
When using the JMWE Related Issue(s) Validator, you can add a conditional validation that allows you to control when the validation occurs. In this scenario, we want to skip the validation when an issue is being cloned.
- Navigate to the Main Menu Bar > Administration Cog, and select Issues.
- In Administration > Issues, select Workflows in the sidebar.
- In the Workflow screen, find your workflow and click on the Edit link in the Actions column.
- In the Diagram view, click on the Create transition and then click on the Validators link available to the right.
- Find the validator that you would like to skip during the cloning process, and click the Edit icon next to it.
- Scroll down to the Validator scope section of the page and select the Conditional validation option.
- In the Condition bar, add the code below, which identifies that a new issue is being created when the issue key is null and an issue is being cloned when the issue key is not null.
- Click the Update button to save the validator changes.
- Click the Publish button to save the workflow changes.
- As a result, the next time you clone the issue, the validation will be skipped.