Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleRequired apps

Power Scripts™ for Jira v2.5.3+ (server)

Level: BASIC

...

The fields have the following options

Select List 1 (customfield_XXXXX)Select List 2 (customfield_YYYYY)
  • Option 1
  • Option 2
  • Option 3
  • 1A
  • 1B
  • 1C
  • 2A
  • 2B

The following scripts will configure the fields so that the only the following combinations can be made:

...

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

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

Result