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
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 have a simple behavior to clear the value of a selection field when the user selects No in another field, and the behavior does not work in the JSD portal. In the Jira UI works perfect (the selection list field value is cleared when the user selects No in another field), but in JSD portal just does not work. I have the proper mappings, so I have no clue why it does not work in JSD portal. Here is the server side script:
def SelectionListField = getFieldByName("List A")
def YesNoField = getFieldById(getFieldChanged())
def selectedOption = YesNoField.getValue() as String
def isYesSelected = selectedOption == "Yes"
//clear SelectionListField value when YesNoField is No
I also tried this but it did not work:
And also tried this but it did not work either:
def optionsMap = ["-1": "None"]
As I said, in JIRA UI works fine but not in JSD portal.
This may be an old issue but it pops up whenever I'm searching for the answer for this, so I'll record my findings here.
Bad Error - causes things to stay in GC
WARN jordan.hauser 853x3046576x1 1fxhefm 10.0.4.185,127.0.0.1 /browse/PR-5018 [c.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'java.lang.NullPointerException - null'.
And in my experience from when I was first trying to figure it out, it leaves stuff in the garbage collector and WILL bring down your server even with ~150 people on it. On certain forms we have multiple tabs for individual line items, and needed some way to mass clear the line items.
Ok Error? - Doesn't appear to affect the GC
2022-09-29 14:13:51,555-0400 http-nio-8080-exec-14 url: /rest/scriptrunner/behaviours/latest/validatorsByPid.json; user: jordan.hauser WARN jordan.hauser 853x3046737x1 1fxhefm 10.0.4.185,127.0.0.1 /rest/scriptrunner/behaviours/latest/validatorsByPid.json [c.o.j.groovy.user.FormField] No option found for customfield_11682 with value -1
For text fields - setFormValue("")
For number fields - setFormValue()
For select fields - setFormValue(-1), setFormValue("-1")
The syntax checker in any of the scriptrunner programming interfaces will yell at you for not including a value for that second one, but it does not produce the error and appears to run fine.