Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

When creating a predefined cascading select field, the option in the first drop-down dropdown list reflects the values available in the second drop-down dropdown list. However, in reporting, the values are combined into a single one. This can restrict the JQL used for filtering. Also, the field only allows users to select a single value in one or both fields.

Solution

You can solve this problem using Power Scripts™ Live Fields. For details on accessing the current screen with Live Fields, go to our documentation.

For the purpose of this example, consider a combination of two fields: Select List 1 (single choice) and/or Select List 2 (multiple choice). 

...

  • Option 1

    • 1A

    • 1B

    • 1C

  • Option 2

    • 2A

    • 2B

  • Option 3

liveField.sil
Code Block
languagejava
lfInstantHook({"customfield_XXXXX", "customfield_YYYYY"}, "hook.sil");
lfWatch("customfield_XXXXX", {"customfield_XXXXX", "customfield_YYYYY"}, "hook.sil", {"change"});
hook.sil
Code Block
languagejava
string v = argv["customfield_XXXXX"];

if (v == "Option 1") {
    lfAllowSelectOptions("customfield_YYYYY", {"None", "1A", "1B", "1C"});
} else if (v == "Option 2") {
     lfAllowSelectOptions("customfield_YYYYY", {"None", "2A", "2B"});
} else {
     lfAllowSelectOptions("customfield_YYYYY", {"None"});
}

The These scripts render the following result.

...