Dynamics CRM, Mobility and other stuff

maandag, juli 07, 2008

Subversion to CRM integration - Part One

At CWR Mobility we use Microsoft Dynamics CRM 4.0 as our bugtracking/features system. You know, sort of eating your own dogfood :).

We use a customized Case entity to track bugs, features and inquiries. We log things like version number, estimated hours to fix/implement, actual hours, etc.

Now we recently moved to Subversion for our sourcecontrol and I thought it would be a good idea to integrate these two systems.

This integration consists of three parts and it's a work in progress. This post describes part one (the easy part).

  1. Log case numbers when committing code and linking to the case in CRM (Part One).
  2. Store revision and changeset information in a custom entity in CRM upon commit in Subversion (Part Two).
  3. Linking from the revision information in CRM to the changelog in Subversion using WebSVN a web-based Subversion repository browser (Part Three).

We are using TortoiseSVN as our Subversion client.

Subversion allows you to add "bugtraq" properties to your repository folders. The first thing we do is add the following properties to the repository root folder using the "svn propset" command. Execute these commands in the command prompt:

svn propset bugtraq:label "CaseID:" .
svn propset bugtraq:message "CaseID: %%BUGID%%" .
svn propset bugtraq:number "false" .
svn propset bugtraq:warnifnoissue "false" .
svn propset bugtraq:url http://crmserver:5555/cs/cases/refertocase.htm?caseid=%BUGID% .
svn commit -q -m "Added CaseId properties to the repository"

Have a look at the TortoiseSVN help file for explanation of these properties, it should be pretty clear. The most important ones are the bugtraq:number and bugtraq:url properties:

  • bugtraq:number "false" means that your not restricted to entering numbers for the CaseID. We are entering a CRM case number, e.g. CAS-01234, so we set it to "false".
  • bugtraq:url contains the url that is used to link to the Case in the bugtracking system.

The url for opening a case in CRM is http://crmserver:5555/cs/cases/edit.aspx?id={SOME_GUID}

We need to link to the CRM case using the case number (the number we add when committing code), not using the case id (primary key), so we need to create an intermediate page that translates the case number to the case id. This is the page you see in the bugtraq:url, namely refertocase.htm. This page takes the CAS-01234 number as a querystring parameter and we use a client-side webservice call to retrieve the related case id and then redirect the request to the official CRM page.

You can find the refertocase.htm page and the tortoisesvn.bat file in the attached zip file.

Note: we put the refertocase.htm in the cases subfolder, which isn't officially supported. You could just put it in the isv folder if you want, but then the code in the refertocase.htm needs to be adjusted a bit to point to the correct edit.aspx page.

Now, with these Subversion properties, when you commit a change you will see a textbox called "CaseID:" where you can enter the CAS-01234 case number.

Enter CaseID upon code commit

Then, when you view the svn log file, you will see a column called "CaseID:" and when you click on a log entry containing a CaseID, the log message will contain a clickable link that will link to the CRM Case:

logmessage

So here it is, the first part of the Subversion to CRM integration. We added a CaseID to Subversion and when you enter a CaseID to a changeset it shows up as a clickable link in the log message. This way when viewing the logs you can easily refer to the related case in CRM. Part two will discuss storing changeset/revision information in CRM using a post-commit hook in Subversion. Stay tuned!

0 Comments:

Een reactie plaatsen

Links to this post:

Een koppeling maken

<< Home