Versions Compared

Key

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


Section


Column
width30%600px


Panel
borderColor#333f48
bgColor#FFFFFF
titleColor#eeeeee
borderWidth1
titleBGColor#333f48
borderStylesolid
titleOn this page

Table of Contents
maxLevel1



Column




Example: Ensure that an issue has at least one attachment

You shouldn't check "Negate validation" since regular behaviour of valifator "validator Validation based on regular expression" is  is to validate that selected field's (or parsed text's) value matches entered regular expression. Look at the image attached to this transition. It shows a configuration that works works fine to force existence of at least a file attached to an issue.


Example 2: Validate that an issue has specific files attached

You may also find useful knowing that you can also validate the type of files attached. Let's suppose we want to validate that our issue has the following files attached:

  • At least 1 .jar file
  • At least 3 images (any format)
  • No more than 5 .txt file
  • Exactly 1 XML file


To implement this validation we will use Boolean validator with math, date-time or text-string terms with the following configuration:


Boolean expression used is:

matches(%{00072}, "(.*application/java-archive.*){1,}") AND matches(%{00072}, "(.*text/plain.*){0,5}") AND matches(%{00072}, "(.*text/xml.*){1}") AND matches(%{00072}, "(.*image/.*){3,}")


Note that:

  • %{00072} is field code for "Attachments with details"


To design this configuration ,I have previously used Copy a parsed text to a field post-function in order to see the value that field "Attachments with details" takes when I attach different file types. Then it's easy to write a regular expressions for matching desired values.


Example 3: Validate attachment file name depending on priority "Criticial"

You can implement that validation using "Boolean validator with math, date-time or text-string terms" with the following boolean expression:

%{00017} = "Critical" IMPLIES %{00071} ~ "rootcause.txt"


Note that:

  • %{00017} is field code for "Priority"
  • %{00071} is field code for "Attachments"


You can also use the following expression in order to allow case insensitive comparison for the name of the attachments:

%{00017} = "Critical" IMPLIES toLowerCase(%{00071}) ~ "rootcause.txt"

You should write the name of the priority exactly as it is.



Other examples of that function

Validaton Validation based on regular expression

Incoming Links
pageCondition and validaton validation based on regular expression
labelsexample



Boolean validator with math, date-time or text-string terms

Incoming Links
pageBoolean condition and validator with math, date-time or text-string terms
labelsexample



Related Usage Examples

Content by Label
showSpacefalse
cqllabel = "example" and label = "validator"