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 !
Is there anywhere a kind of "setAssociatedProjectObjects ?" function ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshua
I didn't realize that your "Maybe" was a link ...
Ok, so I go deep-dive in Atlassian Jira Dev Doc.
If you have a hint ... :)
Regards,
Pascal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ZKB,
I am not familiar with the JAVA API to offer any further assistance. You may want to consider using a Scriptrunner listener/behaviour to directly post the message instead of using a custom field. Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi JIRA-Support ZKB,
I do not know how to accomplish what you are inquiring about, but think there is a risk of data loss. Removing a project from a fields context "may" result in the values for that field to be lost for the entire project. Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshua
Actually, those fields are "Message Custom Fields". They just display a message.
But thank you for your answer !
Pascal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.