Allow edit issue based on custom field single choice value

Sasa Glisic June 22, 2022

Hello,

I have a Single choice custom field (ex "test1"). That field is not visible on Create issue, it is only visible on Edit/View. Field has some values plus None as default. 

Scenario: If user Edit Issue, field Test1 must have some value from the list. None is not a option. How to do this. I manage to set up Listener code bellow, but this doesn't prevent user to choose None if value already exists. 

import com.onresolve.scriptrunner.runner.util.UserMessageUtil
if (cfValues['Test1']?.value == null ){
//Only Warning is shown but field can have None value
UserMessageUtil.warning("Some Error")
}

1 answer

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 22, 2022

Hi Sasa,

A quick fix would be to add a validator to the transition to prevent the user from moving the card if the Test 1 field is empty. 

Sasa Glisic June 23, 2022

Hi John, 

Thank you, but no, because there is no transition if you just Edit. For example if you Edit (which will allow you to not update that Field), then tomorrow I came and try to move to another Status, ... It's not good. 

Simple thing would be to Just make it Required, but then Create screen complains (see above, Field is not present on Create)

Suggest an answer

Log in or Sign up to answer