Home Manage Development Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

by admin

This post will talk about how to make integration of Youtrack with embedded Hub with Teamcity, Gitlab.

YouTrack – a commercial bug tracking system, project management software.YouTrack supports search queries, auto-completion, task set manipulation, task attribute set customization, creation of custom workflows, and implements a keyboard preemption approach.

TeamCity – Intelligent Continuous Integration Server.

GitLab – An open-source DevOps web-based lifecycle tool that presents a code repository management system for Git with its own wiki, bug tracking system, CI/CD pipelining, and other features.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Integration requirements

You need all your tools to be resolved by DNS. If the tools are not resolved by DNS, then some of the functionality will not work for you.

Installation, launch

Youtrack

yum install -y mc unzipwget https://download-cf.jetbrains.com/charisma/youtrack-2020.3.1402.zipunzip youtrack-2020.3.1402.zipcd youtrack-2020.3.1402/bin/./youtrack.sh start

Teamcity

yum install -y unzip mc java-1.8.0-openjdk-develwget https://download-cf.jetbrains.com/teamcity/TeamCity-2020.1.2.tar.gztar zxvf TeamCity-2020.1.2.tar.gzcd TeamCity/bin./runAll.sh start

After installing YouTrack with embedded Hub, Teamcity, Gitlab it is possible to make the following integrations :

  • YouTrack c TeamCity — Build Server Integration
  • YouTrack with Gitlab – VCS Integrations

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

YouTrack Integration with TeamCity – Build Server Integration

Create the same project in Youtrack, Teamcity, and Gitlab.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Teamcity has the VCS connected, which is shown in the screenshot from Gitlab.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

YouTrack created issue number P1-1.

Task : you need to close Issue in YouTrack after a successful build in Teamcity, using Issue number and Fixed command in commit.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Go to Build Server Integration. Connect the Build Server in YouTrack.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Integration of YouTrack with TeamCity must be done project-by-project. To do this in the field Main YouTrack project specify the project in YouTrack. In the field TeamCity project specify the project in TeamCity. In the field TeamCity build specify the task in TeamCity, in which your project will be built. You can set Fixed in build in the Add build numbers to the set of values in a custom field YouTrack will indicate in which build this issue is fixed.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

If you see the message The VCS user namedoes not match any user in YouTrack. , then you need to check and compare VCS user name in the git user.name and in your user settings.

My git log showed me my old data from past experiments.

git logcommit 34ea8e39320e668db4066aa98b425c9fa9f7f7ef (HEAD -> master, origin/master)Author: Anton Patsev <user1@group1.com>Date: Wed Jul 29 11:45:23 2020 +0600text text1 #P1-1 Fixed this issue

You either need to create a new user or add name and email to the user profile.

Also, if you click on the commit 4643208d You will go to TeamCity where you will see an error Unknown (none of TeamCity users defined user1 username in their VCS username settings) TeamCity writes that it does not have a user named user1. Therefore, you need to add it to TeamCity.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

If you have Unknown command: Fixed This means that your user who is trying to close the issue is not allowed to do so.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Add user1 to the Developer role in project project1.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

After that we do one more text commit, which closes the issue. We see that there are no errors, the state is Fixed, in the Fixed in Build field is the number of the task in TeamCity, in which this issue is closed.

VCS Integrations

To demonstrate pure VCS Integrations, let’s disable the integration with TeamCity.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

In Main YouTrack project specify the desired project, select Gitlab, in Repository URL you need to specify the full URL to the desired repository, in Personal access tokenyou need to specify api token. Click Generate token and it will open Access Tokens in the User Settings of your current user.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

Generating token for api. Why don’t other scopes work? Because Youtrack creates a webhook on the Gitlab server.

Specify the token in Personal access token And create an integration.

After creating the integration, check that Youtrack has created a webhook on the Gitlab server. Go to projects1 -> Webhook Settings

Youtrack creates a webhook on the Gitlab server.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

The next step is to allow webhooks on the local network. Next, go to : Admin -> Settings -> Network -> Outbound Requests -> Allow requests to the local network from hooks and services

If you don’t, you will have errors : Unable to save project. Error: Import url is blocked: Requests to the local network are not allowed

Let’s commit to the repository.

Integration of Youtrackwith embedded Hub with Teamcity, Gitlab

In YouTrack we will see that the issue has closed and we will see a pop-up message about the VCS change.

You may also like