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.
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.