Does the API expose a method that allows me to link a teamcity build to an issue?

I'd like to write a small CLI executable that will trigger on successful build in TeamCity that links the build to an issue in YouTrack, sets build number, and changes state.

I know about creating a mapping in YouTrack but the problem is that way doesn't link the build to issue until after the next build executes and I'd like it to happen as soon as the build execution completes.
Hello Diego,

Unfortunately, such method is not implemented in our REST API.
As far as I can see, functionality, that you've described for your CLI, is exactly what we have in our integration with TeamCity.
Could you please provide us with a little bit more details for your use case.
Another assumption I have, is that you need to link a build to an issue, while build is in process of building. Regrattably, this is not implemented, too. Build can be linked to an issue only after it's completed.
It's related to this issue:

I'm not trying to link while it's in progress... I have multiple configurations in TC for my project, one of which is Compile and Build to QA.. I'd like that build to QA configuration to change state of issue from In Progress to Pending QA (unresolved). Later in the workflow, if another build "Deploy to UAT" runs successfully, it should change the issue state to "Pending Approval" (resolved)

I guess based on the answers in the linked posting, what's not supported is changing the state to a specific state that isn't marked "resolved". Is this correct?
also relates to:

Basically, need to add the build to the builds bundle even when issue linked is NOT resolved. I'd like the mapping to apply a command that will SET the new state from an unresolved one.

I'm curious if there was a technical limitation or just a design decision to make the TC Mappings only apply to Resolved issues?
For the time being, I think my solution (work around) for this limitation is:
1. Configure TeamCity mapping in YouTrack so that issues get linked to builds.
2. Make a utility exe app that will run at end of each build, use API to add build number to bundle.
3. utility will also set Fixed in build to appropiate build number.
4. utility will also change state to next step in workflow for issue.

If workflow exposed issue-build links collection with changed event, i'd be able to do all of this within youtrack:

Please sign in to leave a comment.