---
title: "KB : Retrieving changeset data from the internal database"
canonical: "https://support.appfire.com/space/SUPPORT/607322472/KB%20%3A%20Retrieving%20changeset%20data%20from%20the%20internal%20database"
format: markdown
---
The query below will return a list of Jira issue keys and the related TFS changesets by joining information from the **issuehits** and **tfschangesets** tables. This might be useful for customers who need a report of this kind.

First, you'll need to access the database as explained [here](https://extranet.spartez.com/display/SUPPORTSP/How+to+access+%28view%29+SQL+Server+CE+database+file+from+TFS4JIRA+Synchronizer).

Then, you'll need to run the query below:

##### **Query**

```sql
SELECT DISTINCT issuekey, 
                repositoryguid, 
                tfschangeset_id,
		        tfsid,
                date, 
                author, 
                Cast(comment AS NVARCHAR(100)) Comments
FROM   issuehits ih 
       INNER JOIN tfschangesets tcs 
               ON ih.repositoryguid = tcs.tfsrepository_guid 
ORDER  BY ih.issuekey
```