3

1

I would like to have the description field prefilled with a custom template on new case. Example of what I would like to have in the description field is something like this:

[Description of problem] - A detailed description of bug

[Reproduce steps] - Clearly mention the steps to reproduce the bug

[Expected result] - How application should behave on above mentioned steps

[Actual result] - What is the actual result on running above steps i.e. the bug behavior

We are using on-demand fogbugz.

flag

3 Answers

3

You can prefill the edit field by passing a sEvent parameter in the URL. Instead of default.asp?command=new&pg=pgEditBug, the Nip/Tuck FogBugz might use for example

default.asp?command=new&pg=pgEditBug&sEvent=Tell+me+what+you+don't+like+about+yourself.

The easiest way to change the New Case link to do that by default is by using a small BugMonkey script:

$('#Menu_New').attr('href', 'default....')
link|flag
It's a good number of years since I last played with Javascript, but would this approach also allow you to change the 'template' when the user selects a different value in the Category field? I'd like to insert a different template for new features vs. new bugs, for example. – Mal Ross Sep 7 at 10:05
0

Does anyone have an example BugMonkey script that does exactly this? I would imagine that prepopulating a template into a new case is a pretty common request and would like to see if anyone out there has already solved this problem that could be leveraged by others (read: me).

Thanks for the support guys!

link|flag
here's one, a bit late! fogbugz.stackexchange.com/questions/7223/… – adambox Nov 13 at 19:21
0

Here is a bugmonkey script to pre-fill the description. It only fills it for the new case. If you want it for edits also, you can change if (sCommand != 'new') to if (sCommand == 'load')

name:          New case description template
description:   pre-populates the description area on the new case page
author:        Adam Wishneusky
version:       1.0.0.0

js:

$(function(){
    // template for new cases:
    var sTemplate = "Summary: \n\
 \n\
Found on Device: \n\
 \n\
Found in OS: \n\
 \n\
Steps to Reproduce: \n\
 \n\
Expected Results: \n\
 \n\
Actual Results: \n\
 \n\
Regression: \n\
 \n\
Recovery Steps: \n\
 \n\
Server Environment: \n\
";
    // if we're not on the case page, don't do anything
    if (!$('#bugviewContainer').length) return;
    var myFunction = function(sCommand) {
        // only run on the new case page
        if (sCommand != 'new') {
            return;
        }
        if ($('#sEventEdit').length) {
            if ($('#sEventEdit').val().length < 1) {
                $('#sEventEdit').val(sTemplate);
                $('#sEventEdit').focus();
            }
        }
    };
    // this runs on full page load and determines if this is a new case or just viewing a case
    if ($('#sEventEdit').length > 0)
    {
        myFunction('new');
    }
    else
    {
        myFunction('load');
    }
    // run it when the view changes and pass in the new view:
    $(window).on('BugViewChange', function(e, data) {
        myFunction(data.sCommand); 
    });
});
link|flag

Your Answer

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