Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Dear Friends,
I have a cascading select list field
in my project and when i make it mandatory in the field configuration only the 1st value is verified by JIRA. The 2nd value can be empty. It seems to be default behavior for this type of custom fields.
However, i need to go further and enforce that 2nd value is also mandatory. I managed to do this on Create screen by using ScriptRunner script validator in workflow. And it works fine on the Create screen, this is the code I wrote:
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;
import org.apache.log4j.Level
import org.apache.log4j.Logger
//def log = Logger.getLogger("com.acme.workflows")
//log.setLevel(Level.DEBUG)
CustomFieldManager cfm = ComponentAccessor.getCustomFieldManager();
CustomField parentField = cfm.getCustomFieldObject("customfield_11000");
def cascadingListValue = issue.getCustomFieldValue(parentField) as Map
if(cascadingListValue != null){
String parent = cascadingListValue.get(null);
String child = cascadingListValue.get("1");
//log.info("Parent:" + parent);
//log.info("Child: " + child);
return ((parent != null) && (child != null));
} else
return false;
However, the challenge here is with the Edit screen. The Edit action is not associated with any transition, like Create action, and I am not sure if there is any way to force jira to validate that 2nd value is mandatory. Tried to do something with Behaviour but so far no progress here.
If you have any ideas how to achieve this, please let me know. Any thoughts are welcome.
Thank you,
Hi @Rafal Sojka
Whilst I'm not an expert in this area, could you achieve this by using your script to make it mandatory on transition? I know that wouldn't solve your immediate problem of it not being filled on edit, it would mean an issue couldn't be resolved if the information was missing
Thank you Liam, this is a good workaround. However, i wonder if there is any solution to enforce such behavior on the edit screen. This is a part of functionality that is missing here, at least this is how I see it :).
Do you know if we can inject our own javascript code into custom fields as it was possible in the old jira versions ?
Best regards,
Rafal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rafal
If I'm honest, I'm not sure about that. Hopefully someone on here will know the answer, or you could reach out to Atlassian directly.
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.
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.