Skip to end of banner
Go to start of banner

Validators

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Validators check that any input available to the transition (such as user-supplied input) is valid before the transition is performed. If a transition's validator 'fails', the transition's post functions will not be executed and the issue will not progress to the destination step of the transition.

You can use JJupin and SIL to define a large set of validators beside the default validators offered by Jira, by just adding a (k) SIL Validator to a transition and publishing the workflow, as described here.

Below are just a few common examples:

Required plugins

You will need the following JIRA plugin:

  1. JJUPIN

Level: BASIC

Comment required

A validator that forces users to enter a comment during a transition, otherwise displaying a customized error message:

SIL Code
string errorMsg = "You must enter a comment!";
if(!hasInput("comment")) {
   return false, "comment", errorMsg;
}

Field has single value

A SIL validator for checking if a multi-valued field does not contain more than one value during a transition:

SIL Code
string errorMsg = "You must choose a single fix version!";
if(size(fixVersions) > 1) {
   return false, "fixVersions", errorMsg;
}

Parent status

A SIL validator which ensures that the current issue's parent issue is in one of the specified Statuses:

SIL Code
string[] statuses = {"Opened", "Reopened"};
string errorMsg = "Parent issue should have status Opened or Reopened!";
if(!isNull(parent) && !elementExists(statuses, parent.status)) {
   return false, errorMsg;
}
  • No labels