Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Button handy
blanktrue
color#0052CC
nameSend Feedback
linkhttps://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=Scripting+Support+for+Power+Custom+Fields+-+15481129
widthauto

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

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

...

Code Block
//simple example on how to access (get/set) Power Custom Fields™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