You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.