Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19: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.
×Greetings!
I have a next case:
I m trying to restrict changing customfield (type: Deviniti [Dynamic Forms] - Dynamic Select)
It has 3 values: error, customization, changeApp. I want to forbid changing values from error to changeApp and customization to changeApp.
I suppose it can be done by scripts (listeners or behaviours) but i have no relevant expirience of writing dificult scripts. If someone can help or have workaround, pls help.
Unfortunately, from Deviniti documentation, Dynamic Forms for Jira is not compatible with ScriptRunner's Behaviour, you can log your request to ScriptRunner support portal. The more requests, the likely the Product Manager will work on this matter.
Anyway, for other users, Behaviour is the best choice in this use case. If you are using ScriptRunner 6.26 or above, setFieldOptions() is made easier.
So, you can attach following snippet to Initialiser:
def selectField = getFieldByName("Your Select Field Name")
if (underlyingIssue && selectField.getValue()) {
if (selectField.getValue() == "error") {
selectField.setFieldOptions(["error", "customization"])
} else if (selectField.getValue() == "customization"){
selectField.setFieldOptions(["error", "customization"])
}
}
First if statement tests whether you are editing an existing issue with the field is set before. The rest should pretty much self-explanatory.
ah, the snippet can be actually further simplified:
def selectField = getFieldByName("Your Select Field Name")
if (underlyingIssue && selectField.getValue()) {
if (selectField.getValue() != "changeApp") {
selectField.setFieldOptions(["error", "customization"])
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.