The Git adapter query service

The Git adapter provides a REST-based query service that you can use to obtain a list of Rational® Team Concert work items that are associated with a Git commit or Gerrit change ID.

You perform a query by invoking an HTTP GET call. The results are returned in JSON (JavaScript Object Notation) form. Query results can help you compile reports about which work items are included in a build.

Because queries are performed in the context of a Rational Team Concert user account, the query request must be authenticated.

Query formats

Use this format for Gitweb projects:

https://<your.server>:9443/gitAdapter/commit/<registered_git_server_id>/<registered_git_project_with_encoding>/<SHA1> 
Use this format for Gerrit projects:
https://<your.server>:9443/gitAdapter/gerrit-change/<registered_git_server_id>/<registered_git_project_with_encoding>/<change_id>   

Parameters

registered_git_server_id
Identifies the registered Git server to the Git adapter. It can be found in the ID column of the Git Server Connections table on the Git Servers adapter administration page.
registered_git_project_with_encoding
This segment is the name of the registered Git project, including the preceding number_number segment used before the name to handle forward slashes in Git project names such as 0_1/first.git.
SHA1
The Git hash that identifies the commit.
change_id
The Gerrit change ID.
Tip: The easiest way to determine your URL is to copy the link location of a Git commit or Gerrit change link that has been created on a Rational Team Concert™ work item and remove the /identifier at the end of the URL.
In the following example, the URL for the link location ends with the identifier /62. Removing the identifier creates a URL that can be used for queries:
https://clm.jkebanking.net:9443/gitAdapter/gerrit-change/2/7_0_2/gerrit_first/I0d0ac7f2ded88283d075d5377501baf1b38995be/62
becomes
https://clm.jkebanking.net:9443/gitAdapter/gerrit-change/2/7_0_2/gerrit_first/I0d0ac7f2ded88283d075d5377501baf1b38995be
Here is an example of a URL for a query for a Git project:
https://clm.jkebanking.net:9443/gitAdapter/commit/0/0_1/first.git/db5b2db61f6b41279fcd00d4fee94abd12413fd9

Feedback