Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,996
Community Members
 
Community Events
184
Community Groups

BITBUCKET REST api TAG query not giving back the result

I am trying to access git tags with curl command.

The output of git tag -l is the following


[nlakshmi@ROSELCDV0002EXO cool]$ git tag -l *3.10.1.72*
pcv-3.10.1.72-iat1-1
pcv-3.10.1.72-iat1-2
pcv-3.10.1.72-iat1-3
pcv-3.10.1.72-prod2-1
pcv-3.10.1.72-prod2-2
pcv-3.10.1.72-prod2-3
pcv-3.10.1.72-prod2-4
pcv-3.10.1.72-prod2-5
pcv-3.10.1.72-uat1-1

Howver I can do the filtering with git tag and I can do only

[nlakshmi@ROSELCDV0002EXO cool]$ git tag -l *3.10.1.72*iat*
pcv-3.10.1.72-iat1-1
pcv-3.10.1.72-iat1-2
pcv-3.10.1.72-iat1-3

===========================================

I try to use the REST API to get the list of tags with the following URL


[nlakshmi@ROSELCDV0002EXO puppet-config-values]$ curl -sk 'https://mybitbucket.com/rest/api/1.0/projects/cool/repos/pcv/tags?filterText=3.10.1.70' | jq
{
"size": 5,
"limit": 25,
"isLastPage": true,
"values": [
{
"id": "refs/tags/pcv-3.10.1.70-iat1-1",
"displayId": "pcv-3.10.1.70-iat1-1",

},
{
"id": "refs/tags/pcv-3.10.1.70-iat1-2",
"displayId": "pcv-3.10.1.70-iat1-2",

},
{
"id": "refs/tags/pcv-3.10.1.70-iat1-3",
"displayId": "pcv-3.10.1.70-iat1-3",
"type": "TAG",

},

{
"id": "refs/tags/pcv-3.10.1.70-prod2-1",
"displayId": "pcv-3.10.1.70-prod2-1",
"type": "TAG",

},
{
"id": "refs/tags/pcv-3.10.1.70-prod2-2",
"displayId": "pcv-3.10.1.70-prod2-2",

}
],
"start": 0
}

However when I try to filter it down to only the prod ones I don't get back data
Example:


curl -sk 'https://mybitbucket.com/rest/api/1.0/projects/cool/repos/pcv/tags?filterText=3.10.1.70*prod*' | jq
{
"size": 0,
"limit": 25,
"isLastPage": true,
"values": [],
"start": 0
}

So what am I doing wrong to get the tags that I can provide a regex for ?

-Narahari

2 comments

Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 24, 2018

Hi Narahari,

Have you tried encoding the asterisk and changing your URL like so:

https://mybitbucket.com/rest/api/1.0/projects/cool/repos/pcv/tags?filterText=3.10.1.70%2Aprod%2A

Cheers,

Christian

Premier Support Engineer

Atlassian

I tried that but I a seeing the following output.

{
"size": 0,
"limit": 25,
"isLastPage": true,
"values": [],
"start": 0
}

Hi Narahari,

Patterns are not getting detected in Bitbucket REST Api.
You can use the below format to filter prod related tags:

https://mybitbucket.com/rest/api/1.0/projects/cool/repos/pcv/tags?filterText=prod

 And if you want to fetch the recently updated prod related tags then you can use the below format:

https://mybitbucket.com/rest/api/1.0/projects/cool/repos/pcv/tags?filterText=prod&orderBy=MODIFICATION

Hope this helps!!

 

Cheers,

Saranya

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events