Hi there
Customfields can be limited to a list of projects with Field Configuration Schemes.
I created customfields, displaying a warning message. Those fields should only be visible for some projects, according to a project category.
I try to write a script with ScriptRunner to update dynamically the list of projects for those fields – when a project category changes or when I create a new project for example.
I found the way to get the list of projects from a customfield's configuration:
FieldConfig fldConfig
if (schemes != null && !schemes.isEmpty()) {
// Get the 1st field Configuration - should be the default configuration
FieldConfigScheme sc = schemes.get(0);
dbgLog.debug("Field Config: " + sc.getName())
// Get the list of projects for this config - if empty, then global.
lstPrj = sc.getAssociatedProjectObjects()
Now I want to update this list: add or remove projects.
I couldn't find any function allowing that.
Has anybody an idea ?
Thanks in advance !