Skip to main content

attachment

Overview

The attachment function allows you to find issues that have attachments matching specific criteria such as filename, extension, author, and creation date.

Syntax

issue in attachment("subquery", "author", "start_date", "end_date", "filename", "extension")

Parameters

  • subquery (required): A valid JQL query that defines the set of issues to evaluate
  • author (optional): The display name of the attachment author (partial match, case-insensitive)
  • start_date (optional): The start date in format "yyyy/MM/dd HH:mm" or "yyyy/MM/dd"
  • end_date (optional): The end date in the same format as start_date
  • filename (optional): The filename to match (can be exact filename or regex pattern)
  • extension (optional): The file extension or MIME type to match

Supported Operators

  • in - issues matching the criteria
  • not in - issues not matching the criteria

Examples

Finding issues with PDF attachments

issue in attachment("project = TEST", "", "", "", "", "pdf")

Finding issues with attachments by a specific user

issue in attachment("project = TEST", "john.doe", "", "", "", "")

Finding issues with attachments created in a date range

issue in attachment("project = TEST", "", "2024/01/01", "2024/03/31", "", "")

Finding issues with specific filename pattern

issue in attachment("project = TEST", "", "", "", "report.*", "")

Combining multiple criteria

issue in attachment("project = TEST", "john.doe", "2024/01/01", "2024/03/31", "report.*", "pdf")

Finding issues without attachments

issue not in attachment("project = TEST", "", "", "", "", "")

Performance Considerations

  • The function implements pagination to handle large result sets
  • Use specific subqueries and date ranges to improve performance
  • The function limits the number of issues processed to prevent timeout issues

Error Handling

The function will return an error if:

  • Invalid date formats (must be "yyyy/MM/dd HH:mm" or "yyyy/MM/dd")
  • Invalid regex patterns in filename
  • Invalid JQL queries
  • commented - Search for issues with specific comment criteria
  • worklog - Search for issues with specific worklog criteria