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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi
I have a select list(single choice) custom field and a script that returns active sprint for a project, I want this active sprint in any time add to select list(single choice) custom field,
How do I do?
I don't know how add value to SelectListCF with groovy.
thanks
This may not be 100% the best implementation for your use case given how few details you shared, but it is possible to add options to a SingleSelect field using a script.
You would use this API: OptionsManager.createOption
You could add an event listener that watches for "Sprint Created" and will add the newly created sprint to the correct field config. The challenge may be in detecting the correct project and field config to add the sprint to.
The other danger with this approach is that the list of options for your Select List will continually grow and eventually will cause performance problems.
The option suggestion by Fabio may be a better solution.
Hi @MG ,
you have a Select List custom field with some values and you want to add a value retrieved by a script dinamically.
You can't add a value dinamically to a Select List field. You should be able, through a script, to hide some values specified for the field but not add a new value dinamically.
In order to do that, in my experience, you need to create a text field custom field and, through a behaviour, transform it in a select list that aggregate values from your original select list and your script for active sprint.
Take a look to the following doc https://scriptrunner.adaptavist.com/latest/jira/behaviours-conversions.html
Hope this helps,
Fabio
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.