Hello all,
I'm trying to figure out how to script a server side behavior using ScriptRunner which checks the values of multiple customfields to determine the values of a separate customfield.
What makes this difficult is that I will/may already have a behavior set for one or more of the customfields I'm trying to compare the values of in order to display the correct values within the separate field.
For example:
Within the "Create screen" I currently have 5 fields:
Client (Field #1 - single select customfield) {Client 1, Client 2, Client 3}
- Currently has the following behaviors scripted within it:
- (by default) The following fields are automatically hidden:
- Brand, Request Type, Due Date, & Team fields
- If Client 1 is Selected:
- Un-hides Brand, Request Type, & Team fields
- Only allows Brand 1 option to show in Brand field
- If Client 2 is Selected:
- Un-hides Brand, Request Type, & Due Date fields
- Only allows Brand 1 & Brand 2 options to show in Brand field
- If Client 3 is Selected:
- Unhides Brand, Request Type, Team, & Due Date fields
- Allows all options to show in Brand field (Brand 1, Brand 2, Brand 3)
Brand (Field #2 - multi-select customfield) {Brand 1, Brand 2, Brand 3}
- Currently doesn't have any behavior scripts within it.
Request Type (Field #3 - single select customfield) {Request Type 1, Request Type 2, Request Type 3}
- Currently doesn't have any behavior scripts within it.
Due Date (Field #4 - System field)
- Currently doesn't have any behavior scripts within it.
Team (Field #5 - single select customfield) {Team 1, Team 2, Team 3}
- Currently doesn't have any behavior scripts within it.
Main Goal:
Within the example above, I'd like to script a behavior within the Request Type field which checks the values selected within the Client and Brand field to provide specific values accordingly:
- If Client 1 and Brand 1 are selected; Only show Request Type 1
- If Client 2 and Brand 1 are selected; Only show Request Type 1 & 2
- If Client 2 and Brand 2 are selected; Only show Request Type 2
- If Client 3 and Brand 3 are selected; Only Show Request Type 1 & 3
- If Client 3 and Brand 1 or 3 are selected; Only show Request Type 2
If there is anyone that can help, I'd greatly appreciate it!
~Mike