Setting a build field from TeamCity integration

Note this is using YouTrack 2019.3 Build 62973 and TeamCity Enterprise 2019.1.4 Build 66526.

What I am trying to do is have YouTrack/TeamCity integration parse issues mentioned in VCS commits (GitHub) and automatically set a custom field in YouTrack with the build that contains the code changes for that issue.

When looking at the YouTrack help for TeamCity integration, it looks like this should be possible by processing related issues and applying a command to set the field. Unfortunately, I can't seem to get this to work correctly when trying to get it to automatically parse the issue IDs in the commit messages. If I set it to match a query, the builds are then set to issues matching the query (so I know the integration is working), but in our case, we can't set a query that will work correctly (because there is no way to query "issues where state was changed to 'Review' between these dates") so we need it to parse the issue IDs from the commit messages.

Any ideas?

3 comments
Comment actions Permalink

So, after some more testing and playing around with settings. It looks like my problem is that YouTrack is only running the command on resolved issues. The issues I want it to process are not resolved. 

However, after doing some digging and finding this issue, it sounds like what I want should be possible. Am I missing something?

0
Comment actions Permalink

Hello,

Let me clarify it: you need to have "Related issues" or "Issues matching query" option to be selected to make YouTrack process issues. If none of these options is selected, no issues will be processed (even having "Apply command" field specified).
If the "Related issues" option is selected, an issue will be processed only if it is resolved and mentioned in a commit. That is why your example doesn't work - the issue is unresolved.
If only "Issues matching query" option is enabled, an issue will be processed if it matches the query. Actually, all issues which match the query will be processed.
If both options are selected, an issue will be processed if it satisfies any of these two options.

We have a corresponding feature request to allow processing unresolved issues with the "Related issues" option: https://youtrack.jetbrains.com/issue/JT-51652. Please feel free to upvote it to increase its priority and to receive the updates.

Hope it helps. 

0
Comment actions Permalink

Thanks for the response.

I was afraid that was how things were. At least we know for sure and can try figure out how to move forward.

0

Please sign in to leave a comment.