Thursday, February 13, 2014

Integrating TeamSupport Issue Tracker With PHPStorm

While working at WizeHive, I loved how FogBugz integrated so very nicely with PhpStorm.  By creating 'tasks' in PhpStorm, I was able to rapidly switch git branches and open files simply by selecting the desired task.  This enabled me to quickly jump to a specific issue if it moved up in priority (Usually because somebody was standing at my desk asking about it.)

Back at SleepEx, I'm using TeamSupport.  Nobody seems to use it, and it has no integrations with any tools, but it's what I'm stuck with.  So.  Here's how to get tasks working with TeamSupport.

1.  You will need your TeamSupport OrgId and API Token.  If you've used the Team Support API at all, you will already have this.  Otherwise, you will need to get it from whomever manages Team Support at your company.

2.  Next, you need to set the Task preferences in PHP Storm to extend the timeout.  The Team Support API is quite slow.  Without the change, you won't be able to get things working.  To do this, Open preferences in PHP Storm, and go to the tasks section.  Make sure you are using the cache, and set your timeout value quite high.


3.  Now, you are ready to add the Task Server.  In the PHPStorm Tasks preferences, go to the servers section. Add a Generic Task Server. The URL is https://app.teamsupport.com.  Make sure you turn on HTTP Authentication.  The username is your Team Support OrgID and the Password is the API Token.

4.  Now, go to the Server Configuration tab.  Here, I was trying to limit the number of tickets queried as much as possible to try to improve the speed.  You may want to use the API reference to modify your queries.  The bracketed options in the API [gt], [not], etc. did not seem to work for me here.

Task List URL: https://app.teamsupport.com/api/json/Tickets?IsClosed=False&TicketTypeName=Bugs&TicketTypeName=Features&GroupName=Development

Single Ticket URL: https://app.teamsupport.com/api/json/Tickets?TicketNumber={id}  (I used the TaskNumber rather than the ID because the Task Number is clearly visible on the Ticket screen and is the one that most people use when discussing an issue.)

Response Type: Json

tasks: Tickets
id: TicketNumber
summary: Name


5. Now, you are ready to use the Tasks.  You can easily associate a task with a Git commit message, and have your Team Support TicketNumber embedded into your commit messages.  By using a context for each task, the editor will remember which files to have open along with the appropriate Git branch for any given task.