Created
June 10, 2013 05:07
-
-
Save dougn/5746659 to your computer and use it in GitHub Desktop.
FogBugz Customization to allow for URL filling of custom fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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. | |
//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; } */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment