• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • artifactory-plugin
    • None

      In the AQL docs there are examples of sorting and limiting the results from a query.

      Example:

      items.find({"name" : {"$match":"*.jar"}).sort({"$asc" : ["repo","name"]}).offset(100).limit(50)
      

      It would be great if this were also possible when using the download file specs in a pipeline (or other groovy step).

      def downloadSpec = '''{
        "files": [
          {
            "aql": {
              "items.find": {
                "repo": "release-local",
                "path": {
                  "$match": "/builds/master/*"
                },
                "name": {
                  "$match": "*.tar.gz"
                }
              },
              "sort": {
                "$desc": ["updated"]
              },
              "limit": 1
            },
            "target": "./",
            "regexp": "true"
          }
        ]
      }'''
      artifactoryServer.download(downloadSpec)
      

          [JENKINS-42292] Sort, limit results via AQL download spec

          S Thaker added a comment -

          +1 for the feature request. 

          Trying all the ways around this limitation for past 2 days without luck. 

           

          S Thaker added a comment - +1 for the feature request.  Trying all the ways around this limitation for past 2 days without luck.   

          Chris Ladd added a comment -

          Any updates on using AQL sort and limit with the new declarative pipeline commands in 3.0?

          I love being able to use AQL with the new rtDownload step, but need to tell it just to download a limited number of results.

           

          Chris Ladd added a comment - Any updates on using AQL sort and limit with the new declarative pipeline commands in 3.0? I love being able to use AQL with the new rtDownload step, but need to tell it just to download a limited number of results.  

          Sian O'BRIAIN added a comment -

          +1 This would be a great feature

          Sian O'BRIAIN added a comment - +1 This would be a great feature

            Unassigned Unassigned
            stephenash Stephen Ash
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: