Using MS api to connect to TFS defect tracking system
Moderators: Amaradana, TurboPT, TL Developers
Using MS api to connect to TFS defect tracking system
I'm wondering if testlink can be connected to a remote bug tracking server by NOT connecting to the database of bug tracking system directly. I mean skipping the configuration file (e.g. *.cfg.php, jira.cfg.php, etc.)
Has anybody have tried to connect testlink to MS TFS bug tracking system using API provided by Microsoft(http://msdn.microsoft.com/en-us/library/bb130347.aspx).
For security reason, we are not permission to connect to the database directly. It was suggested to use Microsoft API for communicating with defect tracking server. However, I've noticed there are 2 files in testlink, which are used to establish connection with the defect tracking server. One is *.cfg.php and the other one is int_*.php.
It looks like the *.cfg.php is used to make connection between Testlink and bug tracking database, while the second file int_*.php is used to retrieve data.
What I'm trying to do is using only API provided by microsoft and skip using direct connection to database.
- Is it doable?
- Does *.cfg.php file do anything other than to ensure testlink is connected to bug tracking server database? And can we skip the connection step and only use API?
I appreciate your help and suggestion as I do not know much about the testlink architecture and PHP scripting, so no idea how much time and effort it takes to make it work.
Has anybody have tried to connect testlink to MS TFS bug tracking system using API provided by Microsoft(http://msdn.microsoft.com/en-us/library/bb130347.aspx).
For security reason, we are not permission to connect to the database directly. It was suggested to use Microsoft API for communicating with defect tracking server. However, I've noticed there are 2 files in testlink, which are used to establish connection with the defect tracking server. One is *.cfg.php and the other one is int_*.php.
It looks like the *.cfg.php is used to make connection between Testlink and bug tracking database, while the second file int_*.php is used to retrieve data.
What I'm trying to do is using only API provided by microsoft and skip using direct connection to database.
- Is it doable?
- Does *.cfg.php file do anything other than to ensure testlink is connected to bug tracking server database? And can we skip the connection step and only use API?
I appreciate your help and suggestion as I do not know much about the testlink architecture and PHP scripting, so no idea how much time and effort it takes to make it work.
Re: Using MS api to connect to TFS defect tracking system
I'm currently looking for doing automatic create/update of requirement from TFS to TestLink using product backlog workintem, and bring back from TestLink to TFS bugs encountered during test execution in defect workitem.
The problem is to choose how:
- is it possible to use ms api in php code of testlink to manage that at TestLink object level ?
- or create a c# project to use ms api and work at db level ?
- or other solution ...
So i'll keep an eye to your thread.
The problem is to choose how:
- is it possible to use ms api in php code of testlink to manage that at TestLink object level ?
- or create a c# project to use ms api and work at db level ?
- or other solution ...
So i'll keep an eye to your thread.

Re: Using MS api to connect to TFS defect tracking system
jirasoap interface is an example that can be used to develop the interface.
on 1.9.4 we are going to refactor but tracking system integration via API
on 1.9.4 we are going to refactor but tracking system integration via API
Re: Using MS api to connect to TFS defect tracking system
I could make it work, however, it is not very easy like integrating with other bug tracking system.
I'm going to provide a well description and "how to do" instruction for integrating Testlink to Microsoft Team Foundation Server/Service (TFS) when I'm done. I'm sure there are many people, who want to do it (or wanted but just saw no hope and went for another BTS or TCM).
Many big companies are using Microsoft products for their defect tracking system, source version control, etc. I'm sure many of them will use Testlink, if they know that TFS can be integrated with it.
There is no open source test case management out there that supports TFS. This can be a very positive point for Testlink, if we make it work.
Anyhow, the good news is that integrating Testlink with TFS can be done. I can add or delete bugs to a test case and Testlink get the latest status of the bug from TFS as soon as there is a change in the state of bug in TFS.
Currently, I'm facing following issues to claim that mission accomplished:
1- I get a "An unhandled win32 exception occurred in httpd.exe[3876]" warning, during adding/deleting a bug to/from a test case.
2- Don't have access right (at least Read Only)to TFS database, so have to bypass any db-connection in testlink
The second issue, will be solved once I get "Read Only" access right, hopefully.
The first issue is kind of confusing for me and not sure where to start. My guess is that there is a incompatibility issue between PHP and Apache libraries in my environment. The reason is that, I've had to uninstall PHP.5.3.7 and replace it with PHP5.2.17. Why? because Testlink calls a couple functions for connecting to mssql database. These functions are part of php_mssql.dll, which is in php5.2 Not php5.3.
Downgrading PHP and messing with Apache and PHP libraries to make things work, can be a reason for that annoying warning message. I'm afraid to re-install PHP and Apache as doing that may cause more issue.
I appreciate it, If anybody could give me a help/hint/suggestion on how to get rid of that "Unhandled exception ..."
warning.
Is it possible to attach a screenshot to a post here?
Cheers,
Ali
I'm going to provide a well description and "how to do" instruction for integrating Testlink to Microsoft Team Foundation Server/Service (TFS) when I'm done. I'm sure there are many people, who want to do it (or wanted but just saw no hope and went for another BTS or TCM).
Many big companies are using Microsoft products for their defect tracking system, source version control, etc. I'm sure many of them will use Testlink, if they know that TFS can be integrated with it.
There is no open source test case management out there that supports TFS. This can be a very positive point for Testlink, if we make it work.
Anyhow, the good news is that integrating Testlink with TFS can be done. I can add or delete bugs to a test case and Testlink get the latest status of the bug from TFS as soon as there is a change in the state of bug in TFS.
Currently, I'm facing following issues to claim that mission accomplished:
1- I get a "An unhandled win32 exception occurred in httpd.exe[3876]" warning, during adding/deleting a bug to/from a test case.
2- Don't have access right (at least Read Only)to TFS database, so have to bypass any db-connection in testlink
The second issue, will be solved once I get "Read Only" access right, hopefully.
The first issue is kind of confusing for me and not sure where to start. My guess is that there is a incompatibility issue between PHP and Apache libraries in my environment. The reason is that, I've had to uninstall PHP.5.3.7 and replace it with PHP5.2.17. Why? because Testlink calls a couple functions for connecting to mssql database. These functions are part of php_mssql.dll, which is in php5.2 Not php5.3.
Downgrading PHP and messing with Apache and PHP libraries to make things work, can be a reason for that annoying warning message. I'm afraid to re-install PHP and Apache as doing that may cause more issue.
I appreciate it, If anybody could give me a help/hint/suggestion on how to get rid of that "Unhandled exception ..."
warning.
Is it possible to attach a screenshot to a post here?
Cheers,
Ali
Re: Using MS api to connect to TFS defect tracking system
@aostad
Are you having to use the command-line equivalent for the TFS stuff, or some other technique?
I was about to ask if there was some way that a "sandbox area" could be created so that I might try to help, but it seems that you have it going. [I don't have any TFS available, but don't ming helping if still needed]
That error seems general in nature, and I could suggest checking the server's error logs for any potential clues, or the Windows Event Viewer might also provide a clue. Is the number in the brackets always the same? If not, then it could be referring to the process that caused the exception -- assuming that it is not the process# of the http instance itself.
Picture. Yes, with the "full editor" there is an 'Img' button where you can add a url for an image that has been uploaded somewhere, such as imageshack or some other 'free' site.
Are you having to use the command-line equivalent for the TFS stuff, or some other technique?
I was about to ask if there was some way that a "sandbox area" could be created so that I might try to help, but it seems that you have it going. [I don't have any TFS available, but don't ming helping if still needed]
That error seems general in nature, and I could suggest checking the server's error logs for any potential clues, or the Windows Event Viewer might also provide a clue. Is the number in the brackets always the same? If not, then it could be referring to the process that caused the exception -- assuming that it is not the process# of the http instance itself.
Picture. Yes, with the "full editor" there is an 'Img' button where you can add a url for an image that has been uploaded somewhere, such as imageshack or some other 'free' site.
Re: Using MS api to connect to TFS defect tracking system
Thanks TurboPT for offering your help. I think I can not make a sandbox available to you because of very strict security rule in our company. But I will update you and others of the progress as I have been looking into this integration and asking for any hint for a while, but no reply. So, I definitely share with others my experience and solution.
Regarding your question about command-line, I'm not using any command-line equivalent. Generally speaking, I've written a small piece of program in C# and using Microsoft API to connect to TFS. In the same program I've made a couple call to APIs for reading the data of a desired defect number. In next step, I call that piece of code, which is in C#, from Testlink, which is in PHP.
What I've explained above is simply the high level design. Although it looks simple and easy but figuring out what to do took me some time. With this simple procedure, somebody with a little bit programming experience can implement it. However, I'll provide all details and code in this forum. I prefer to get rid of some issues that I've mentioned in my previous post, then take care of documenting and provide you with all details.
I've uploaded 4 images to imageshack that shows how a bug in TFS is added to testlink, Let me know, if you can't access to following url, as this is the first time that I use imageshack:
http://imageshack.us/g/854/addingtfsbug91948totest.jpg/
Cheers,
Ali
Regarding your question about command-line, I'm not using any command-line equivalent. Generally speaking, I've written a small piece of program in C# and using Microsoft API to connect to TFS. In the same program I've made a couple call to APIs for reading the data of a desired defect number. In next step, I call that piece of code, which is in C#, from Testlink, which is in PHP.
What I've explained above is simply the high level design. Although it looks simple and easy but figuring out what to do took me some time. With this simple procedure, somebody with a little bit programming experience can implement it. However, I'll provide all details and code in this forum. I prefer to get rid of some issues that I've mentioned in my previous post, then take care of documenting and provide you with all details.
I've uploaded 4 images to imageshack that shows how a bug in TFS is added to testlink, Let me know, if you can't access to following url, as this is the first time that I use imageshack:
http://imageshack.us/g/854/addingtfsbug91948totest.jpg/
Cheers,
Ali
Re: Using MS api to connect to TFS defect tracking system
Could you share your small piece of c# ? i'll be interested a lot in !
So to have a correct workflow we must have:
- export product_backlog_item from TFS to requirement spec in TestLink
- export defect_item from TFS to TestLink in an execution of test case associated to requirement (but which ?)
- import requirement spec in TestLink to product_backlog_item in TFS
- import defect_item in TFS from execution test case (with bugs associated) of TestLink
So to have a correct workflow we must have:
- export product_backlog_item from TFS to requirement spec in TestLink
- export defect_item from TFS to TestLink in an execution of test case associated to requirement (but which ?)
- import requirement spec in TestLink to product_backlog_item in TFS
- import defect_item in TFS from execution test case (with bugs associated) of TestLink
Re: Using MS api to connect to TFS defect tracking system
please open issue on mantis and upload your work there, is much better that using the forum
Re: Using MS api to connect to TFS defect tracking system
Yes, the images are viewable.
To the "unhandled exception":
You said it happens during bug add/delete...does it still happen if all the debug outputs are disabled?
I crossed another post on the web that said the exception might be caused by output such as converting a resource to a string. [such as a connection or a resultset]
To the "unhandled exception":
You said it happens during bug add/delete...does it still happen if all the debug outputs are disabled?
I crossed another post on the web that said the exception might be caused by output such as converting a resource to a string. [such as a connection or a resultset]
Re: Using MS api to connect to TFS defect tracking system
I have added a couple images of errors and unhandled exception. As the event viewer shows, there is a proble with php5ts.dll. As I said before, I have replaced PHP5.3.7 with 5.2.17. I guess this runtime error is as a result of mismatching different dll in testlink, php, sqlserver, etc.
here is the new screenshot of windows event viewer:
http://imageshack.us/photo/my-images/81 ... ringa.jpg/
http://imageshack.us/photo/my-images/82 ... php5t.jpg/
http://imageshack.us/photo/my-images/27 ... ledex.png/
here is the new screenshot of windows event viewer:
http://imageshack.us/photo/my-images/81 ... ringa.jpg/
http://imageshack.us/photo/my-images/82 ... php5t.jpg/
http://imageshack.us/photo/my-images/27 ... ledex.png/
Re: Using MS api to connect to TFS defect tracking system
We have posted on twitter info about changes we have done regarding SQL SERVER drivers, upgrading PHP ADODB library.
(https://twitter.com/#!/TLOpenSource/sta ... 5077218306)
Best option is using Last XAMPP version because you get in one enviroment all you need.
Mixing versions and dll will produce only one result lot of wasted time.
If TFS has an API then, this is the way to go and NOT DIRECT DATABASE ACCESS.
What about: http://tfsapiwrapper.codeplex.com/ ?
http://www.microsoft.com/download/en/de ... en&id=4240
http://labs.seapine.com/wiki/index.php/TFS_Integration
(https://twitter.com/#!/TLOpenSource/sta ... 5077218306)
Best option is using Last XAMPP version because you get in one enviroment all you need.
Mixing versions and dll will produce only one result lot of wasted time.
If TFS has an API then, this is the way to go and NOT DIRECT DATABASE ACCESS.
What about: http://tfsapiwrapper.codeplex.com/ ?
http://www.microsoft.com/download/en/de ... en&id=4240
http://labs.seapine.com/wiki/index.php/TFS_Integration
Re: Using MS api to connect to TFS defect tracking system
TFS api is accessible only by .net no ? any gateway in php known ?
Re: Using MS api to connect to TFS defect tracking system
an API accessible only using ONE LANGUAGE? Yes has to be a microsoft product, as usual.
Re: Using MS api to connect to TFS defect tracking system
OK. As I promised I've prepared the document that explains how I have integrated Testlink with TFS. It may not be perfect but works just fine for me and I'm going to improve it as needed.
at the bottom of document, I've mentioned a couple things that need to be improved. Please share your solution with the community, if you come up with any improvement.
Here is the link:
https://docs.google.com/open?id=0B4VVp5 ... VJQQ1NXa0k
Cheers,
Ali
at the bottom of document, I've mentioned a couple things that need to be improved. Please share your solution with the community, if you come up with any improvement.
Here is the link:
https://docs.google.com/open?id=0B4VVp5 ... VJQQ1NXa0k
Cheers,
Ali
Re: Using MS api to connect to TFS defect tracking system
Great!.
One minor notice: you are going to refactor this implementation for 1.9.4, because bugtracking integration config has been moved to DB, and interface classes also has to be placed in a new folder, and had to follow new rules.
No doc available yet, just code working ready on gitrepo for 1.9
One minor notice: you are going to refactor this implementation for 1.9.4, because bugtracking integration config has been moved to DB, and interface classes also has to be placed in a new folder, and had to follow new rules.
No doc available yet, just code working ready on gitrepo for 1.9