Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Setting current value of group picker field when group picker field is null

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2018

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!

2 answers

1 accepted

0 votes
Answer accepted
Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2018

Solved. using changelog event. :)

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2018

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)

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2018

Hi @Nic Brough -Adaptavist- , my problem is that I'm retrieving a group , how can I do that?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2018

The call to get a custom field will give you a collection of groups.  You will need to iterate over that.

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 12, 2018

Hi @Nic Brough -Adaptavist- , do you have any idea on how can I get the changed value from something to null?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events