Hi,
I am trying to run a simple script on the jira issue create screen. I am struggling with how to deploy it.
I have a question and if you answer yes it should display a further 3 questions. If you answer no none of these questions should display.
I believe a script similar to this one i found on the forum should work but i am just unsure of where to add a listener or how to actually execute.
def select = getCustomFieldValue("Select")
if (select) {
return select
}
else {
return null
}
Many thanks for you help
Welcome to community.
In order to do that, you should use Script Runner's Behaviours feature.
Go to;
Than, add your field (your question field). And add server side script for this field.
Here is an example;
def questionField = getFieldById(getFieldChanged())
def questionVal = questionField.getValue() as String
def otherField = getFieldById("customfield_XXXXX")
if(questionVal.equals("No")) {
otherField.setHidden(true)
otherField.setRequired(false)
} else{
otherField.setHidden(false)
otherField.setRequired(true)
}
ps: It works in Create & Edit dialogs unless you specify a condition.
Regards
Hey thanks for you reply, I cant seem to see an option for behavious under add-on for some reason?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I couldn't understand the problem, can you please share a screenshot?
*You can also click "." button on keyboard and type "Behaviours" on pop-up.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are using cloud version, got it.
As I know, only server version supports Behaviours feature because of some limitations in cloud.
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.