I'm trying to conditionally update by post function a single choice select list.
When doing it by post function copy cf value from field to field - in certain cases it's being updated textually but in a two dimensional gadget for these values I can see that this issue is in "None" value.
Trying to do so by a scripted post function too - but I can't find the option_id's for its optional values.
I can see that this something like "cusomfield_xxxx-val" and then the text of the value.
Thanks
You need to get and set an option object, not a string or id.
The snippet I used for fetching one should get you going:
def customFieldManager = ComponentManager.getInstance().getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjectByName("My colour list")
def fieldConfig = cf.getRelevantConfig(issue)
def value = ComponentAccessor.optionsManager.getOptions(fieldConfig)?.find { it.toString() == 'Red' }
Hi,
What if the issue is on creation phase ?
I tried this method in init behaviour, for create issue, it didn't work
Thanks in advance,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same question also.
During issue creation, there is no "issue" object to pass into getRelevantConfig function. How do we get the fieldConfig without "issue" object?
def fieldConfig = cf.getRelevantConfig(??no issue object during create??)
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.