Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get the creation date of a tag in BitBucket Server Edited

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 the tag as I can create a tag at any point in time regardless of the commit author/commiter date.

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

1 answer

0 votes
Mikael Sandberg Community Leader Jan 24, 2020

Hi @mikimicheli,

Welcome to Atlassian Community.

The only way to get the date of the tag is to use the git show <tag> command, that will give you the date when the tag was created.

I'm also trying to do exactly this. In the Bitbucket cloud rest API we get a date when the tag was created but in the Bitbucket Server we don't. 

If I'm using API calls is because I can't use git commands in the scripts I'm building. Is there any other alternative?

I use the creation date of the tag to compare then with the merge date of pull requests to provide a list of (origin) branches that got merged since the tag was created (in other words: the branch names (not code diffs or commit list) of which changes are not included in the specified tag)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

525 views 6 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you