I'd like to hide a field based on another field's value. if summary's value contains 'XYZ', then hide, otherwise not hide. I'm not sure how to express field contains xxx keywords in script and my script now is like below.
However, even if summary equals exactly XYZ, this code still doesn't work when I edit the issue. Anyone can give a hint or revise for this?
You're declaring the 'hidefield' via getFieldByName("xx"), which returns you the field - and then you are trying to do an equals comparison on it, by string, i.e. field == "XYZ". So those are 2 different object types.
See the API documentation on how to get the value from the field:
Which should be hidefield.getValue() and as that is Summary, that should return String, in which case equals/== will work, or you can use .contains("XYZ").
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.