JqlClauseBuilder builderAllIssues = JqlQueryBuilder.newClauseBuilder(); JqlClauseBuilder tempQueryAllIssues = builderAllIssues.project(specifiedProject.getId()); Query queryAllissues = tempQueryAllIssues.buildQuery(); SearchResults searchResultsAllIssues = searchProvider.search(queryAllissues, specifiedProject.getLead(), PagerFilter.getUnlimitedFilter()); List<Issue> allIssues = searchResultsAllIssues.getIssues();
The above JQL builder query returns all issues. But, my requirement is to return issues who have attachements only.Is there any way i can get issues with attachments by modifying this query?
I have never been able to get a JQL working to filter issues that have attachments. As a workaround, I add the "number of attachments" field and from there exclude all issues that have 0 as value for that field.
project = "some-project" AND NOT attachments is EMPTY
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
works!!!Thx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the current JIRA Cloud version this seems to work:
attachments IS NOT EMPTY
You're welcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not by modifying that query directly, but you can use hasAttachments() function from the script runner plugin.
You have to reindex after installing the plugin for that function to work, but that is also true if you add the "number of attachments" field as Mick suggests.
Note that using this function is much quicker than checking each issue for attachments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What i dint understand is "
number of attachments" field.Is this some kind of cutom field i need to create or something is avaialbe in JIRA.How can i incorporate this field in the below JQL query...SearchResults searchResultsAllIssues = searchProvider.search(queryAllissues, specifiedProject.getLead(), PagerFilter.getUnlimitedFilter());
List<Issue> allIssues = searchResultsAllIssues.getIssues();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it's in jira suite utils or jira toolkit IIRC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JQL query is: issue in hasAttachments()
You can also read this page to learn more: http://www.j-tricks.com/jqlt-issue-functions.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Project = ABCD AND attachment is not EMPTY
will list for you the issue that their attachment is not empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.