Hi,
I am trying to make a Radio button field (Rejection Reason) un-hidden and required when the resolution 'Rejected' is chosen but it is not working. This script works when the reason field is a list but is not working for a radio button.
Can anyone advise what changes I need to make in order to have the script function with a radio button?
import com.atlassian.jira.issue.resolution.Resolution
def resolutionField = getFieldById("resolution")
def RejectionReason = getFieldByName("Rejection Reason")
def resolution = resolutionField.getValue() as Resolution
if (resolution.name == "Rejected") {
RejectionReason.setRequired(true)
RejectionReason.setHidden(false)
} else {
RejectionReason.setRequired(false)
RejectionReason.setHidden(true)
}
Hi @Stephen Marsh ,
Are you trying to enable this in the edit screen? Because it would not work in a transition screen!
If you only want it in the edit screen, it can be done (when you edit the issue, the field will appear or not depending on the resolution value)!
Did you Add a Mapping? Because if it is not mapped to a project, it will not work.
I hope this helps, otherwise let me know and I'll try to help you further!
JT
Hi JT,
Thank you for your reply... Apologies for the delay, I have been away for the past few days.
I was racking my brains trying to figure out why the script wasn't working but I had it mapped to the wrong project :-(
Thanks for your help :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.