Brief summary of this article:
This integration plugin is outdated and does not connect GitHub or GitLab branches, merge or pull requests and Targetprocess work items directly. To link the items to the branches, consider using brand new native Targetprocess integration with GitHub, GitLab, Bitbucket, and Azure Devops.
This article describes how to set up Targetprocess one-way integrations for automatic import of source control commits from Git repositories.
When a Git integration is set up, Git users are able to update Targetprocess work items when they submit commits to Version Control repositories. They update entity states, submit time records, and post comments using special shortcut commands.
The integration plugin does not synchronize work items in Targetprocess with issues in GitLab or GitHub. To synchronize work items, consider using Tasktop Integration Hub.
The following Git hosting providers are supported by the plugin:
- GitHub
- Bitbucket
- GitLab
- Team Foundation Server with Git
- Microsoft Visual Studio Team Services (VSTS, visualstudio.com) with Git. Detailed information specific to VSTS users is here: Import Git / TFVC Version Control Commits from VSTS to Targetprocess.
Only Targetprocess Administrators have permission to configure the Git plugin's settings.
To setup the Git plugin, go to Settings → System Settings → Plugins, and add a new Git Integration profile:
If the Git plugin icon is missing from the plugins page, check the troubleshooting guide.
A plugin profile can only leverage one repository at a time. If you need to import revisions from several repositories, you can add a new profile for each of them.
Profiles are not tied to your Targetprocess Projects and Teams. So, you can use both one repository for many Targetprocess projects, and many repositories for one Targetprocess project.
For Profile Name, use any unique name. Remember, you can’t change this name later.
This is how a full repository path should look:
- git://github.com/Company/Project.git
- https://github.com/Company/Project.git
- file:///c:/Repository
- //localserver/trunk
- http://localserver:8080/tfs/company/_git/TfsGit
- https://accountname.visualstudio.com/P1/_git/P1%20Git
- ssh://git@github.com/Company/Project.git
To connect to a local Git repository from a web-based Targetprocess account, make sure the proxy server in your network accepts and forwards incoming connections from the web to your Git.
Access Credentials
Two access methods are supported. You can connect to your Git account using Login and Password credentials pair or using a SSH key pair.
Login and Password
Use the credentials of any Git account that has access to the specified repository, and has the permissions to clone it.
SSH keys
Use an existing SSH key issued in OpenSSH format.
If you don’t have keys yet, you can generate them either directly in the Targetprocess by clicking Generate keys for me button or on your side using Git Bash app. How to issue a new SSH key pair from Git Bash and use it in Targetprocess.
Users Mapping
When emails of your project members in Git and Targetprocess are different, you should map Git emails to Targetprocess user accounts in Targetprocess Git plugin profile settings. The users will be treated as Unknown in Targetprocess otherwise.
Commits created by unknown users are successfully attached to Source tabs of Targetprocess work items. However, no further actions such as state change, comment submit, time spent record post are performed with work items.
By default, users in Git and Targetprocess are mapped automatically if one of the following is true:
- Git email = Targetprocess email
- Git Name = Targetprocess Full Name (First Name + Last Name)
- Git name = Targetprocess Login
Otherwise, you'll need to map out your users:
Importing Revisions
As soon as the profile is created, Targetprocess will import Git revisions starting from the date you’ve specified. This can take several minutes.
You can track the import status in the log:
Setting up Plugin Profile using REST API
It's possible to set up plugin profiles using REST API.
You should send POST request to the following URL:
[youraccountname]/api/v1/Plugins.asmx/Git/Profiles?token=your_token_here
In order to obtain token you should send the following API request:
[youraccountname]/api/v1/authentication
More ways to authenticate through API can be found here
Setting up a plugin profile with SSH keys based authentication:
{ "Name": "Profile created via API", "Settings": { "Uri": "https://github.com/Test/Test.git", "SshPrivateKey": "SSH_Private_Key_Here", "SshPublicKey": "SSH_Public_Key_Here", "StartRevision": "01/01/2019", "SyncInterval": "60", "UserMapping": [ { "Key": "test@test.com", "Value": { "Name": "Administrator Administrator", "Id": "1" } } ] } }
Setting up a plugin profile with login/password based authentication:
{ "Name": "Profile created via API", "Settings": { "Uri": "https://github.com/Test/Test.git", "Login": "login", "Password": "password", "StartRevision": "01/01/2019", "SyncInterval": "60", "UserMapping": [ { "Key": "test@test.com", "Value": { "Name": "Administrator Administrator", "Id": "1" } } ] } }
Commit Messages Format and Actions
Now, you can use the following commit messages for certain actions:
Action | Commit message (#ID format) | Commit message (id:ID format) |
---|---|---|
Change states | #ID state:fixed |
id:ID state:fixed |
Add comments | #ID comment: text of your comment here |
id:ID comment: text of your comment here |
Add time spent | #ID time:1 |
id:ID time:1 |
Add time spent and time remaining | #ID time:4:8 |
id:ID time:4:8 |
Update several entities at a time | #ID, #ID comment: will not be fixed state:invalid time:0.5 |
id:ID, id:ID comment: will not be fixed state:invalid time:0.5 |
All the actions in one commit message | #456, #887 state:done time:3:0 comment:whoa! Everything is completed! |
id:456, id:887 state:done time:3:0 comment:whoa! Everything is completed! |
Make sure you enter the commit messages as shown above. Comments, time entries, and states will not update if the format is incorrect. Special words like comment and state are case sensitive, so you cannot use "Comment:" starting with a capital "C" in your commit message.
Multi-line comments are not supported at the moment.
In this example, as soon as the commit is done, the status of the entity with ID=584 will be changed to Done. The comment "Should be included to the current release" will be added to the entity, as well as the values for spent time (1 hour) and remaining time (2 hours).
View Source
You can see all updates from Git in the Source tab:
The Source tab is only shown if the Source Control practice is enabled for the Process your Project is based on. If you don't see the Source tab, enable the practice in Settings → Process setup → [Edit your process] → Practices. Administrators only can activate practices.
The plugin shows commit time records exactly as they are in Git. Multiple time zones and local settings are not supported.
For details on changes, click the Diff link:
If you delete a repository, the plugin profile, or both, the Diff links will become unavailable.
Need a more powerful integration with GitHub?
Targetprocess can be integrated with GitHub via our special Zapier bridge.
On-premise / On-Site TFS services
In the personal settings for your user account, you’ll need to enable alternate credentials.
Setup authentication with a TFS-based Git repository when Active Directory integration is configured
You may need to additionally configure TFS in order to allow alternative credentials for this sort of setup.
- On your hosting server, install basic authentication service role
- In IIS, change settings to let the TFS service accept this basic authentication
- In IIS, provide AD user mapping
- In the TFS administration console, set Authentication to NTLM
On your hosting server, install the basic authentication service role if it is missing. To install it, you go to Control PanelPrograms and Features then select Turn Windows features on or off. This will open a new dialog for you, go under the security node and check basic authentication and click OK.
Then in IIS you need to enable basic authentication for your TFS service and the TFS node inside it.
- http://localserver:8080/
- http://localserver:8080/tfs/
Go to IIS Manager, select Team Foundation Server. From the right panel select Authentication and disable everything other than basic auth.
Then restart your IIS. This way basic authentication will be enabled.
On TFS node, it may also be required to edit and set the domain and realm to the domain used for authentication:
Once you have the proper authentication mechanisms set up, you need to pick the account that the agent is going to run under, and assign the correct rights in TFS and the build pool.
Still have a question?
We're here to help! Just contact our friendly support team.