Once upon a time, an awesome customer put together this short tutorial on using the XML API to import tasks from Microsoft Excel. The tutorial content has been slightly modified since then, but the general steps are the same.
For example, let’s say you have 500+ tasks in Excel with these columns:
- Assigned To
- Case Comment
Here’s one way to get these into FogBugz using the API:
- Get an API token. (API tokens last until you click log off in the web interface.)
- Add a UrlEncode function to your Excel workbook
- Add a “Command” column to the worksheet containing the tasks, with this formula:
="[YOUR FOGBUGZ URL]/api.asp?token=" & "<INSERT_TOKEN>" & "&cmd=new" & "&sProject=" & urlencode(A2) & "&sArea=" & urlencode(B2) & "&sTitle=" & urlencode(C2) & "&sFixFor=" & urlencode(D2) & "&sPersonAssignedTo=" & urlencode(E2) & "&ixPriority=" & F2 & "&sTags=" & SUBSTITUTE(G2," ",",") & "&sEvent=" & urlencode(H2)
NOTE: Replace <INSERT_TOKEN> below with the value from step (1). You can also add additional fields supported by the API, including custom fields by adding columns and the appropriate parameter to the formula.
- Ensure that wget is installed. You can download this as a self-contained executable here. You’ll need to put this in a system path.
- Copy and paste the contents of the Command column into a text file,
- Make a batch file,
fb.bat, containing the following command:
wget --spider --no-check-certificate -i "x:\users\herb caudill\desktop\fb.txt"
wgetto hit all the URLs listed in the text file. The
--spiderswitch tells it to ignore the results rather than saving them as a file; the
--no-check-certificateswitch tells it to ignore SSL certificate issues.
- Once you run the batch file, your cases should get created. For example:
Don’t hesitate to contact us if you have any questions!