Skip to end of banner
Go to start of banner

Scripting Support for Power Custom Fields

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

After you install Power Custom Fields, you can access the custom fields using the standard syntax: customfield_<id>.

The field’s value is always an array of KPOption that represents the selected options in the field.

Example

//simple example on how to access (get/set) Power Custom Fields fields

//we assume we have an issue context here
KPOption [] options = customfield_12345;

if(size(options) > 0) {
    runnerLog("First option id = " + options[0].value + " and the label is :" + options[0].label);
}

//we'll assume this is a multi-select field, because otherwise it will not work
KPOption nopt;
nopt.label = "Extra topping";
nopt.value = "99";
options += nopt;

customfield_12345 = options; //here's the set
  • No labels