3

Update May 2023: There is no way to achieve this from the API for Stash

Using BitBucket Server (aka Stash) version 6.3.0 I am trying to filter tags of a repository according to a specific date range., but can't find the creation date of a tag.

From the API Docs, using the GET /REST/API/1.0/PROJECTS/{PROJECTKEY}/REPOS/{REPOSITORYSLUG}/TAGS API we can order the results by modification date, but the tag object itself does not contain a created/updated field. This is not related to if the tag is annotated or not.

Tag response:

{
    "size": 1,
    "limit": 25,
    "isLastPage": true,
    "values": [
        {
            "id": "release-2.0.0",
            "displayId": "refs/tags/release-2.0.0",
            "type": "TAG",
            "latestCommit": "8d351a10fb428c0c1239530256e21cf24f136e73",
            "latestChangeset": "8d351a10fb428c0c1239530256e21cf24f136e73",
            "hash": "8d51122def5632836d1cb1026e879069e10a1e13"
        }
    ],
    "start": 0
}

The only option I have found so far is to fetch the commit itself, but the date of the commit isn't necessarily the date of tag as I can create a tag at any stage regardless of the commit creation date.

Does anyone know of any workaround regarding this that I can use in order to get the creation date of a tag?

Chaos Monkey
  • 964
  • 1
  • 6
  • 18

0 Answers0