13

3

Greetings!

Situation: We have a CRM system that generates unique customer IDs. Now we added a field "customer match code" to our Fogbugz cases, using the Custom Fields Plugin.
In the CRM we have a button "Add case to customer" that launches a VB script to open a URL, ie. Fogbugz.

Obviously, it would be nice to pre-fill the custom field "customer match code" with the ID. Normal fields are easy to pre-fill:

http://devserver/fogbugz/default.asp?command=new&pg=pgEditBug&sTitle=MyTitle

Since the field is a custom field, I found it not in the table "Bug", but in "Plugin_6_CustomBugData", where it is called "customerxmatchxcodeX62".
Neither accessing "customerxmatchxcodeX62", nor "customer match code", nor "Customer Match Code" worked.

Does anyone know of a way to access custom fields like this?

Note: I am aware of the XML API. I'm trying to avoid it in this case, because all I want to do is open a browser with Fogbugz "new case" page and fill this one field.

Thank you for any helpful responses!
Best regards,
Robin

See also the various values you can set in the URL of the case edit page.

Edit:
In this thread I found that setting custom fields via XML API seems to work. However, using the same syntax does not work, in this specific case:

http://devserver/fogbugz/default.asp?command=new&pg=pgEditBug&P6_customerxmatchxcodeX62=Test

Fog Creek Case FC1865273

flag
note: I updated my answer – adambox May 25 2010 at 14:54

3 Answers

2

We have a case open to consider this feature for a future release. Please up-vote this question to show your support for adding this feature.

link|flag
Consider this an up-vote for this feature. The question has been locked, so I can't up-vote it in the standard fashion. :) – Ben Collier Aug 7 2011 at 13:41
oops! I unlocked it. please up-vote the question. thanks :) – adambox Aug 10 2011 at 18:06
2

In the abscence of this feature, I have used a javascript customisation script to set fields from the URL

if(goBug && goBug.ixBug === 0){//only run on new bug
    function getURLParameter(name) {
        return decodeURI(
            (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,''])[1]
            );
        }

    $('#clientS15').val(getURLParameter('clientS15'));
    }
link|flag
nice work ! – adambox Nov 21 2011 at 14:39
1

Here is the BugMonkey plugin I wrote to handle this in a generic way. Just prefix your custom field magic name (ie. versionxreportedf85) with 'custom_'. This way you don't need custom javascript per field.

name:        Auto Fill Custom Fields
description: Find any arguments on in the URL for a new case which start with 'custom_' and attempt to fill that field with the value.
author:      Doug Napoleone
version:     1.0.0.0
minApi:      1.0

js: 
// based on inspiration from:
//    http://fogbugz.stackexchange.com/questions/2427/feature-request-pre-fill-custom-fields-on-new-case-edit-page-via-url-parameter
// But only 1 line remains from that origional.

// Example:
//  http://bn-fbdb01.nuance.com/default.asp?command=new&pg=pgEditBug&ixProject=2&ixCategory=2&ixArea=58&custom_reportedxversiong83=1.22.100.12345

//only run on new bug
if(goBug && goBug.ixBug === 0)
{
    var searchString = window.location.search.substring(1);
    var params = searchString.split("&");

    for (var i = 0; i < params.length; i++) {
        var val = params[i].split("=");
        var name = unescape(val[0]);
        if (name.substring(0,7) == "custom_")
        {
            $("#"+name.substring(7)).val(unescape(val[1]));
        }
    }
}


css: 
/* body { background-color: red !important; } */
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.