0

I would like to add a custom field to the 'Add a new Bug Event' section. I looked at the CaseEventEdit plugin, but it looks like there is not an API function to modify the Edit view for BugEvents, only the display view.

We would like to add additional fields in the TextBox for edits as well as the Email response TextBox. This would just be for inserts, we won't need to modify the BugEventEdit plugin to add the additional fields.

This would be so the edit fields are all located together and not off in the side menu.

Is this possible? Where in the API is this located?

Thanks!

flag
Maybe move the custom fields using jQuery? – Michel de Ruiter Jul 18 at 7:42
Thanks Michel. Just for reference, the easiest was I found to move the field was to remove the original field and add it back with $('#submitButtonsEdit').before(<HTML of field>). – Rob Jul 18 at 14:29

1 Answer

1

There is not currently an API for doing this.

If you use the Custom Fields plugin, you can control whether your custom fields appear above the case edit textbox (in the same area as project, category, status, etc.), or in the side bar. You can also control the ordering of your custom fields relative to each other.

If that's not quite what you're after, then I think your best solution (as Michel suggested in his comment) might be to write a BugMonkey customization that uses jQuery to move your specific custom fields into the desired location/grouping.

Something like the following should get you pointed in the right direction:

function myFunction() {
    // only do magical things if this is the case page and we're in edit/email mode
    if (!($('#bugviewContainer').length && $('#sEventEdit').length)) return;

    console.log('doing magical things to the case page...');
}

// run our function after client-side view/edit/email mode transitions
$(window).on('BugViewChanging BugViewChange', function(e, data) {
    console.log(e.type, data.sCommand);
    myFunction();
});

// run our function on page load in case this is the edit/email page
myFunction();
link|flag
I was able to move the custom fields with jQuery, but I like your example better than what I used. thanks! The plan was to add a 'Time spent' box under the case edit or email reply, which would then add a time interval (as opposed to using the current time spent on the case) and would dynamically add the interval ending at the current time. This field would be associated with a BugEvent, not the case, so I was hoping there was some way to just add a field, but I think a custom field that does not actually store the data, just used to pass it through should work. Thanks! – Rob Jul 18 at 13:43

Your Answer

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