The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
John Funk
Community Champion
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)

DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events