Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can prevent the Jira issue from transition to the next state if not all Smart Checklist items are checked.

...

  1. Go to Workflows

  2. Choose one that you want to add validation to and click Edit

  3. Choose transition and click on "Validators" link

  4. Add Validator

  5. Choose "Smart Checklist Completed Validator"

  6. Click Add - new Validator will be saved

  7. Then Publish this changed workflow

...

Code Block
def checklist = issue.get("customfield_10113");
if (!checklist) {
  return true;
}
def checklistItems = checklist.split('\n').findAll({ it -> it.matches("^[-|+|~].*")});
for (item in checklistItems) {
  if (!item.startsWith("+") && (item.contains("Code reviewed") || item.contains("Unit tests written and passing"))) {
	return false;
  }
}
return true;

Fixing slow

...

Issue transition with validation enabled

Info

The following information could be helpful if the checklist validation is noticeably slowing down the issue Issue transition.

The validations are essentially based on the following query:

...

Update statistics

In order to assure the performance of that query, the database administrator needs to be sure that correct statistics are present in the database. This can be done with the following SQLs:

...