We are trying to make it where A field is hidden on a screen unless one of the two highlighted choices are picked:
Here is the code that I used in behaviour:
Where are you adding the script?
Because for me it worked when I added my script under behaviours.
Best,
Fadoua
That's where I am adding them. Is mapping needed? I haven't used the behaviours before so I don't know if I am missing something.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to add the script to the field you are making selections on "customfield_11011"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It still hasn't worked, but I am running a re-index since fields have been added and the behaviour to see if that will help. If doesn't I will share a screen shot of how I have the behaviour setup.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still didn't work. Here is how I have the behaviour setup.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please add an initializer
define both dropdown
add a condition getActionName == "Create"
dropdownfield.setFormValue(null)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry now I see what you are trying to achieve.
I was under the impression you are hiding a field based on the option selected from a different field which is not the case
I am little bit confused. Sorry if you can provide more details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So what I am trying to do is make "customfield_19915" visible only when one of the two highlighted options in the original post are selected. Then if any of the other options are selected then the field stays hidden. The reason for this is if the one of those two options are selected then the client needs to be notified and if not they don't.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry wrong post.
Ok @Aaron Andrade then your script is wrong.
Try Carmen's solution as suggested below, it is what I did in my script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On your script you are getting a field Id and the same field you are getting its value which I think is wrong. However I am not a Groovy expert.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! I will give that code a try and see if we can get it to work. Thank you for all the help I appreciate it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using the forum post you sent me and some documentation for scriptrunner I got the code to work see below the new code:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It always makes my day when I get this kind of confirmations. Thank you for the update @Aaron Andrade !
If satisfied with the help provided please don't forget to accept my answer.
Best,
Fadoua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would happen to know how to change the code to make it work for a multiselect list or know where to point me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me check then get back to you
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.
Why don't you try and to your if condition if (A == x && A == y) {
script goes here
}
The same one you had earlier with the &&
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.