Hi Community. I need help on retaining group picker field value when it is set to blank or null using scriptrunner listener.
Scenario is after the issue has been made, if someone edited the group picker field and set it to blank/null/none , the group picker field will retain its value. Can someone help? Thanks!
Solved. using changelog event. :)
Set the listener to look for all events where someone might blank it out (probably "issue updated" and possibly events in your workflow if you've got transition screens for them)
In the event, you'll be able to get a handle on the issue, where you can then say "if the value changed from <something> to <null>/blank, then get old value and put it back"
Start the code with https://library.adaptavist.com/entity/update-the-value-of-a-custom-field-using-a-listener (that's the update to set the value back, I'm not 100% sure how to get the old value off the top of my head)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- , my problem is that I'm retrieving a group , how can I do that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The call to get a custom field will give you a collection of groups. You will need to iterate over that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- , do you have any idea on how can I get the changed value from something to null?
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.