Features used to implement the examples
Example: Ensure that an issue has at least one attachment
You shouldn't check "Negate validation" since regular behaviour of validator Validation based on regular expression 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
Validation based on regular expression
- Make "Affects Version/s" mandatory when issue resolution is "Fixed"
- Make a custom field mandatory when Priority is "Critical" or "Blocker"
- Make a custom field mandatory when priority is "Critical" or "Blocker" and issue type is "Incident"
- Make certain custom field required in resolve screen only if the resolution was set to "Fixed"
- Prevent addition of new sub-tasks if the parent issue is in "Resolved" or "Closed" status
- Validation on issue attachments
- Validation on the value of a Cascading Select field
Boolean validator with math, date-time or text-string terms
- Block a transition until all sub-tasks have certains fields populated
- Block an epic's transition depending on linked issues status and due date
- Block or hide a transition for an issue depending on its issue links
- Block or unblock a transition after an issue rested a specific time in a status
- Block transition until all sub-tasks are in a specific status category
- Close parent issue when all sub-tasks are closed
- Enforce a field (Select List) to be set when another field (Radio Button) has a certain value (works with any kind of field type)
- Ensure that all issues linked with a certain issue link type have "Due Date" field set
- If field A is populated then, field B must also be populated
- Limit issue creation per role and issue type
- Limit the number of hours a user can log per day
- Limit valid dates for work logs
- Make "Time Spent" field required when there is no time logged in the issue
- Make a custom field mandatory when priority is "Critical" or "Blocker" and issue type is "Incident"
- Make attachment mandatory depending on the value of certain custom field
- Make different fields mandatory depending on the value of a Select List custom field
- Make linked issues, sub-tasks and JQL selected issues progress through its workflows
- Make parent issue progress through its workflow
- Prevent issue creation if another issue with same field value already exists
- Reject duplicated file names in attachments
- Require at least one sub-task in status "Resolved" or "Closed" when "Testing required" is selected in Check-Box custom field
- Require issue link when resolving as duplicate
- Restrict parent issue from closing if it has sub-tasks that were created during a given parent issue status
- Restrict sub-task type creation depending on parent issue status
- Restrict sub-task type creation depending on parent issue type
- Set a condition in a global transition which only applies in a certain status
- Validate a custom field "Story Points" has been given a value in Fibonacci sequence
- Validate compatible values selection among dependent custom fields
- Validate only issue links created in transition screen
- Validate that multi-user picker custom field A does not contain any user in multi-user picker custom field B
- Validation and condition based on time expressions
- Validation based on the value of a date type project property
- Validation on issue attachments
- Validation on MIME types of issue attachments
- Validation on sibling sub-tasks depending on issue type and status
- Validation on the value of a Cascading Select field