Fetching Cases with Commentaries and Attachments Using FogBugz API


Follow

Overview

FogBugz can export to CSV. However, this process has a drawback that it does not capture comments and attachments. This article shares an alternative process to fetch cases with commentaries and attachments using the FogBugz API. 

Requirement: Install Postman or any other application that works with Rest API calls.


 

Process

You can return both, a list of cases and any other exact information about them at the same time using the cols parameter in the Search Cases API call: https://api.manuscript.com/#Search-Cases

Consider the following example as a test case to understand the process for fetching cases with commentaries and attachments using the FogBugz API.:

  1. After logging on through the API, https://api.manuscript.com/#Logging-on-Through-the-API, you will receive a token. You can also obtain a token via the UI.

     

  2. To search for a case or cases, use https://api.manuscript.com/#Search-Cases, bypassing the token and query above. For instance, to retrieve the metadata of case #24, use the following call body:
    {
    "token": "<Enter token from step 1>",
     "q": "case:24",
     "cols": ["events"]
     } 

     

  3. Check for all comments listed in column s, as indicated below for this example:

    mceclip1.png

     

  4. Compare the comment or comments with FogBugz UI, as seen below:

    mceclip2.png

     

  5. If you have an attachment, it will be presented under the rgAttachments property, as seen below for this example:
     "rgAttachments": [
    {
    "sFileName": "24__Test_case_-_FogBugz.png",
    "sURL": "default.asp?pg=pgDownload&amp;pgType=pgFile&amp;ixBugEvent=370&amp;ixAttachment=6&amp;sFileName=24__Test_case_-_FogBugz.png&amp;sTicket="
    }
    ],

     

  6. Copy the sFileName value (e.g. 24__Test_case_-_FogBugz.png) and amend it to your FogBugz instance URL, as seen below. Make sure that the value returned by the API call for ixAttachment (6 in the example above) is set for the same parameter in your FogBugz instance URL.

    https://trilogy-team.manuscript.com/default.asp?ixAttachment=6&pg=pgDownload&pgType=pgFile&sFilename=24__Test_case_-_FogBugz.png

     

  7. Repeat the procedure above for all cases to retrieve all the comments and attachments.