Versions Compared

Key

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

On this page:

The screen script enables you to determine if an action requires additional input and to build a form where the user can fill in the necessary data.

Input Types

Power Actions™ provide a variety of input fields to suit your needs. 

Image Removedcheckbox group

Category

Input Type

Examples

Content

HTML content

Image Added

Wiki content

No options, single value

Texttext

Image Added

textarea

single checkbox

date picker

date time picker

user pickerText Area

Single Checkbox

Date Picker

Date Time Picker

User Picker

No options, multiple values

file uploadFile Upload

Image Added

Multiple options, one selectable value

select list

radio groupSelect List

Image Added

Radio Group

Multiple options, multiple selectable values

multi select list

Multi Select List

Image Added

Checkbox Group

Anchor
new-method
new-method

Creating the Screen

(v2.0.8+ for Jira 5 and 2.6.1+ for Jira 6)

Starting with versions 2.0.8 and 2.6.1 we have improved the screen, so now all you have to do to add an input on the screen is call the respective routine for that input type. No more adding to a huge array and returning it. Note that returning the array will revert to using the old method which does not support newer input types.

The input fields are created using a script that contains specially designed routines that create the fields. See the following pages for each routine that can create an input:

Child pages (Children Display)
pageInput Type Routines

Additional Screen Building Routines

InfoAvailability

Available in v2.0.8 for Jira 5 and v2.6.1 for Jira 6 and above

In addition to adding controls to the screen, Power Actions™ provide more routines to control the way your screen is displayed. For example, changing the dialog title, the text on the submit button.

See the following pages for each routine that can interact with the screen:

Child pages (Children Display)
pageDialog Control Routines

Examples

Creating the Screen (up to v2.0.7 for Jira 5 and 2.6.0 for Jira 6)

Warning

Deprecation

This method of creating the screen is deprecated starting with version 2.0.8 for Jira 5 and 2.6.1 for Jira 6. New input types added in versions 2.0.8+ and 2.6.1+ will not work using this method.
Scroll down to see thenew-method.

The script must return an array of strings, containing parameters for each field that should be displayed. The array will be built from concatenated sub-lists, each of which will describe a field to be shown on the screen. However, if the script does not return a value or the value is empty, no screen will be shown.

To help create the string array that needs to be returned, we have created some app-specific SIL routines with a user-friendly syntax that will return a sub-list for each field.

Category

Input Type

SIL routine

Parameter types

No options, single value

TEXT

BA_createInput(label, defaultValue, isDisabled)

label : string

defaultValue: string

isDisabled : boolean

TEXT_AREA

BA_createTextArea(label, defaultvalue, isDisabled [, rows])

label : string

defaultValue: string

isDisabled : boolean

rows: number. An optional parameter to specify how tall the text area should be, in lines.
If not specified, the default will be "3".

SINGLE_CHECKBOX

BA_createSingleCheckbox(label, isSelected, isDisabled)

label : string

isSelected: boolean

isDisabled : boolean

No options, multiple values

FILE_UPLOAD (since v. 2.5)

BA_createFileUpload(label, isDisabled)

label: string

isDisabled : boolean

Multiple options, one selectable value

SELECT_LIST

BA_createSelectList(label, options, defaultValue, isDisabled)

label : string

options: string []

defaultValue: string (must match one of the options or empty string)

isDisabled : boolean

RADIO_GROUP

BA_createRadioGroup(label, options, defaultValue, isDisabled)

Multiple options, multiple selectable values

MULTI_SELECT_LIST

BA_createMultiSelectList(label, options, defaults, isDisabled)

label : string

options: string []

defaults: string [] (must match some of the options or empty array)

isDisabled : boolean

CHECKBOX_GROUP

BA_createCheckboxGroup(label, options, defaults, isDisabled)

Note

Note

Be sure to gather all sub-lists into a single array and return it at the end of the script.

Examples (up to v2.0.7 for Jira 5 and 2.6.0 for Jira 6)
Example Screen Script
Code Block
boolean isDisabled = false;
stringboolean []isRequired ret = BA_createSelectList("select list", {"", "select me!", "ss1", "no, select ME!", "nobody loves this option", "ss2"}, "", isDisabled);
ret = arraysConcat(ret, BA_createInput("text input", "some text", isDisabled));
ret = arraysConcat(ret, BA_createMultiSelectList("multi select", {"select me!", "ss1", "no, select ME!", "nobody loves this option", "ss2"}, {"ss1", "ss2"}, isDisabled));
ret = arraysConcat(ret, BA_createSingleCheckbox("check box", true, isDisabled));
ret = arraysConcat(ret, BA_createCheckboxGroup("checkbox group", {"o1", "o2", "o3"}, {"o1", "o2"}, isDisabled));
ret = arraysConcat(ret, BA_createRadioGroup("radio group", {"r1", "r2", "r3"}, "r1", isDisabled));
ret = arraysConcat(ret, BA_createTextArea("text area", "text area of many, many words", isDisabled));
ret = arraysConcat(ret, BA_createFileUpload("files", isDisabled)); 
return ret;

The above script will create one input of each type on the following screen.

Image Removed

Examples (v2.0.8+ for Jira 5 and 2.6.1+ for Jira 6)

Example screen script
Code Block
boolean isDisabled = false;
boolean isRequired = true;
string badesc = "this is a description";
BA_createHtmlContent("<h1>Title</h1>");
BA_createCheckboxGroup("cbx grp", {"a", "b", "c"}, {"a", "b"}, isDisabled, isRequired, badesc);
BA_createInput("input", "asdftrue;
string badesc = "This is a description";

//Content
BA_createHtmlContent("<h1>HTML Title Text</h1>");
BA_createWikiContent("h2. Wiki Subtitle - TEST-2 Cool :D");

//No options, single value
BA_createInput("input", "asdf", isDisabled, isRequired, badesc);
BA_createTextArea("ta", "some text", isDisabled, 3, isRequired, badesc);
BA_createSingleCheckbox("cbx", true, isDisabled, isRequired, badesc);
date d = currentDate();
BA_createDatePicker("date", d, isDisabled, isRequired, badesc);
BA_createDateTimePicker("datetime", d, isDisabled, isRequired, badesc);
BA_createUserPicker("userpicker", "admin", isDisabled, isRequired, badesc);

//No options, multiple values
BA_createFileUpload("File Upload", isDisabled, isRequired, badesc);

//Multiple options, one selectable value
BA_createMultiSelectListcreateSelectList("mselSelect List", {"a", "b", "c"}, {"a", "b"}, isDisabled, isRequired, badesc);
BA_createRadioGroup("radioRadio Group", {"a", "b"}, "a", isDisabled, isRequired, badesc);
BA_createWikiContent("h2. Wiki subtitle - TEST-2 cool :D");
BA_createSelectList("sel
//Multiple options, multiple selectable values
BA_createMultiSelectList("Multi Select List", {"a", "b", "c"}, {"a", isDisabled, isRequired, badesc);
BA_createSingleCheckbox("cbx", true"b"}, isDisabled, isRequired, badesc);
BA_createTextAreacreateCheckboxGroup("ta",Checkbox Group"some text", isDisabled, 3, isRequired, badesc);
BA_createFileUpload("file", isDisabled, isRequired, badesc);
date d = currentDate();
BA_createDatePicker("date", d, isDisabled, isRequired, badesc);
BA_createDateTimePicker("datetime", d, isDisabled, isRequired, badesc);
BA_createUserPicker("userpicker", "admin", {"a", "b", "c"}, {"a", "b"}, isDisabled, isRequired, badesc);

BA_setActionTitle("customMultiple titleoptions, formultiple actionselectable 1values");
BA_setExecuteButtonText("do not executeExample"); 
Image Removed

See also

  • Condition Script

  • Action Script
     

    Contents

    Table of Contents
    excludeSee also

    See More

    Child pages (Children Display)
    pageConfiguring a Power Actions Custom Field