I'm a "C/perl with C++ from 15 years ago" guy but I'm slowly picking up Java/Groovy syntax on the side so any help would be appreciated.
I reviewed Jamie's page: https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts and tried various formats:
--> cfValues['Planned For'][0] == "main"
--> cfValues['Planned For'].contains("main")
--> cfValues['Planned For']*.value.contains("main")
--> cfValues['Planned For']?.value.contains("main")
assert cfValues['Planned For'] == "main"
| | |
| [main] false
[Customer:null, Planned For:[main], ...]
So 'Planned For' is an array but lets confirm:
assert cfValues['Planned For'].class == "main"
| | | |
| [main] | false
| class java.util.ArrayList
[Customer:null,
Planned For:[main], ...]
What are the elements of the array?
assert cfValues['Planned For'][0].class == "main"
| | | |
| [main] | false
| class com.atlassian.jira.project.version.VersionImpl
[Customer:null,
Planned For:[main], ...]
After much head banging for checking a custom field(Planned For) of Versions
Here's my condition of a validator where
if Manager then allow
else if Planned For is null then allow
else if Planned For only equals "main" version then allow
else if Planned For only equals "trunk" version then allow
else fails
isUserMemberOfRole('Managers') || cfValues['Planned For'] == null || cfValues['Planned For']*.getName() == ["main"] || cfValues['Planned For']*.getName() == ["trunk"]
or can use the contains method if one of the multiple version is set to xxxx. i.e. "main"
cfValues['Planned For']*.getName().contains("main")
Great, previewing the question really doesn't help with formatting. ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!
Register todayOnline 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.