简体   繁体   中英

REST API Teamcity - Get list of changes that contain a specific tag

Ultimately, I want to have a list of all build configurations that contain any changes with a specific version tag. Based on what I am seeing in the documentation, this should work to get me the raw data that I can form to my needs:

http://<server>/httpAuth/app/rest/builds/?locator=tags:($version),count:50000

I've tried using specific version number tags and the stable tag, and even with 50000 results, it finds zero when looking for tags. I removed the tag locator, and got 49,000+ results, so I know that part works.

Even with a list of builds or changes, the response doesn't have any tag information on those results to even parse through.

Am I missing something? Is there a better way to get this information out of TeamCity through the API?

I'm not sure what your $version variable references, but here's an example that can get the information back for a known tag name.

  1. Tag a build - here I'm using the tag mytag

在此处输入图片说明

  1. Use the following request to get the builds back that have the known tag, and also return the changes.

    http://<server>/httpAuth/app/rest/builds?locator=tags(mytag)&fields=build(changes(change),tags(tag))

在此处输入图片说明

If you want to return additional information about the build you'll have to add it to the fields information eg

http://<server>/httpAuth/app/rest/builds?locator=tags(mytag)&fields=build(id, number, status, changes(change),tags(tag))

This will return additional information about the build's id, number and status.

在此处输入图片说明

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM