On this page



Use case

Validate that an issue has specific files attached.

In this use case, we want to validate that our issue has the following files attached:

  • At least one .jar file
  • At most five .txt files
  • Exactly one .xml file
  • At least three images (any format).


Configuration


Add the Logical validator to the desired workflow transition.


Expression

Add the following expression:

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


Expression in detail:

FilesExpression
At least 1 .jar file


matches(%{issue.attachments.details}, "(.*application/java-archive.*){1,}")


At most 5 .txt files


matches(%{issue.attachments.details}, "(.*text/plain.*){0,5}")


Exactly 1 XML file


matches(%{issue.attachments.details}, "(.*text/xml.*){1}")


At least 3 images


matches(%{issue.attachments.details}, "(.*image/.*){3,}")






Screenshots


Related use cases




JWT feature

Workflow function

Logical validator

Logical condition

Use case descriptionValidate that an issue has specific files attached.
Parser functionmatches()
Label





Status
Tech review

Style guide