List All Label Names?

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
CoffeeNerd
Posts: 25
Joined: Tue Mar 16, 2010 8:54 am
Location: Seattle, WA

List All Label Names?

Post by CoffeeNerd » Tue Mar 16, 2010 9:34 am

Hello,
Is it possible to get a list of known label names from Vault? I see all the ways I can work with labels if I know what the label is actually named but if I don't have this information I need a way to get it in order to use the other calls surrounding the label functionality.

What I'd like to use this for is to create a deployment client that could migrate groups of files through different levels of 'readyness' that exist within our repository (e.g. development, unit test, QA, certification, release) where the only thing the files would have in common is a label assigned by the developer, these files are located throughout the Vault repository - they not all in the same folder and keeping them all in one folder would not work with the way things have been set up.

If there is already a better way to do this that doesn't re-invent the wheel I'd like to know about that as well.

Thank you!

-CoffeeNerd
Murray Williams | Starbucks Coffee Company

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: List All Label Names?

Post by lbauer » Tue Mar 16, 2010 10:31 am

There's no easy way to do this with the API or other Vault Clients. You can use the show labels command from the Vault GUI client to list labels recursively from root or another folder. This will show you all the label paths and label names, but you'd need to manually write down all the labels, since there's no way to copy this.

I've logged feature request 15326 for this functionality.
Linda Bauer
SourceGear
Technical Support Manager

CoffeeNerd
Posts: 25
Joined: Tue Mar 16, 2010 8:54 am
Location: Seattle, WA

Re: List All Label Names?

Post by CoffeeNerd » Tue Mar 16, 2010 12:58 pm

lbauer wrote:There's no easy way to do this with the API or other Vault Clients. You can use the show labels command from the Vault GUI client to list labels recursively from root or another folder. This will show you all the label paths and label names, but you'd need to manually write down all the labels, since there's no way to copy this.

I've logged feature request 15326 for this functionality.
Thank you Linda, much appreciated.

I'm new to Vault, currently evaluating it for our use; is there a fair chance that this feature request could appear in a not-too-distant release of Vault?

-CoffeeNerd
Murray Williams | Starbucks Coffee Company

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: List All Label Names?

Post by lbauer » Tue Mar 16, 2010 1:13 pm

It's hard to say. It depends on what other features they might be considering, and how much development time we have for the next release. Wish I could be more specific.

If other users see this post and would like this feature, please let us know. The more requestions we have for this feature, the more likely we are to implement it
Linda Bauer
SourceGear
Technical Support Manager

surak8
Posts: 16
Joined: Mon Nov 30, 2009 2:04 pm

Re: List All Label Names?

Post by surak8 » Wed Apr 14, 2010 11:02 am

I actually have a couple routines that do this (for different display-purposes).

I will post them, if you are interested.

You should know, however, that I recommend executing the query at the "project" level, and not at the root of repository, as the underlying API functions can take a while.

CoffeeNerd
Posts: 25
Joined: Tue Mar 16, 2010 8:54 am
Location: Seattle, WA

Re: List All Label Names?

Post by CoffeeNerd » Mon Feb 07, 2011 12:09 pm

Hi Surak8,

We are finally on Vault now and I would be interested in these, thank you!
surak8 wrote:I actually have a couple routines that do this (for different display-purposes).

I will post them, if you are interested.

You should know, however, that I recommend executing the query at the "project" level, and not at the root of repository, as the underlying API functions can take a while.
Murray Williams | Starbucks Coffee Company

Feji
Posts: 1
Joined: Sat Dec 17, 2011 11:29 pm

Re: List All Label Names?

Post by Feji » Sun Dec 18, 2011 1:25 pm

I find this feature would be helpful, too. Please, announce if you will be going to implement it in future. TIA

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: List All Label Names?

Post by lbauer » Mon Dec 19, 2011 4:06 pm

Thanks, I've added your "vote."
Linda Bauer
SourceGear
Technical Support Manager

simpalm
Posts: 2
Joined: Fri Feb 26, 2016 7:17 am

Re: List All Label Names?

Post by simpalm » Fri Feb 26, 2016 7:23 am

Hey Linda,

Is this feature available now?

simpalm
Posts: 2
Joined: Fri Feb 26, 2016 7:17 am

Re: List All Label Names?

Post by simpalm » Fri Feb 26, 2016 7:25 am

Is this feature available now?

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: List All Label Names?

Post by jclausius » Sat Feb 27, 2016 7:54 pm

One can already retrieve labels applied at objects using the BeginLabelQuery(), GetLabelQueryItems_*() and EndLabelQuery() API for a folder or any object found under a folder using the API. If you also knew a label name, you could also use the the HistoryBegin(), HistroyFetch() and HistoryEnd() API looking for just labels on a specific folder.

In regards to the idea in CoffeeNerd's 2nd paragraph, unless I'm misunderstanding something in the write-up, this functionality was added back in Vault 7's Folder Changes Archive
Jeff Clausius
SourceGear

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: List All Label Names?

Post by Tanguy » Thu Jul 07, 2016 2:21 am

lbauer wrote:There's no easy way to do this with the API or other Vault Clients. You can use the show labels command from the Vault GUI client to list labels recursively from root or another folder. This will show you all the label paths and label names, but you'd need to manually write down all the labels, since there's no way to copy this.

I've logged feature request 15326 for this functionality.
Is it still not possible to show all labels of a project with the .NET API?

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: List All Label Names?

Post by Tanguy » Thu Jul 07, 2016 3:28 am

FYI

I posted a solution on Stack Overflow --> http://stackoverflow.com/questions/3822 ... 0#38241920

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: List All Label Names?

Post by Beth » Thu Jul 07, 2016 10:15 am

On lbauer's comment, that was from back in 2010, and the function that can do it now didn't exist then. Thanks for posting your solution. I'm sure others will find it useful.
Beth Kieler
SourceGear Technical Support

Post Reply