Is it possible to get annotated tag information via tag name in TFS 2017 API? There is an Annotated Tag section in the documentation, but it wants the object ID of the tag.
I have the Repository ID and Commit ID at my disposal - if not possible to query by tag name, can I get all tags on a commit or somehow convert a tag name into an object id?
You may try the API to Get a list of references (branches/tags).
GET https://mytfsserver/DefaultCollection/_apis/git/repositories/aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb/refs/tags?api-version=1.0
Here is the sample response in that document.
{
"count": 3,
"value": [
{
"name": "refs/tags/v1.0",
"objectId": "23d0bc5b128a10056dc68afece360d8a0fabb014",
"url": "https://mytfsserver/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/refs/tags/v1.0"
},
{
"name": "refs/tags/v1.1",
"objectId": "23d0bc5b128a10056dc68afece360d8a0fabb014",
"url": "https://mytfsserver/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/refs/tags/v1.1"
},
{
"name": "refs/tags/v2.0",
"objectId": "23d0bc5b128a10056dc68afece360d8a0fabb014",
"url": "https://mytfsserver/DefaultCollection/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/refs/tags/v2.0"
}
]
}