Screen Script
Looking for the documentation on the newest versions of Power Actions for Jira 8? Click here and leave these dusty old pages behind!
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.
Category | Input Type | |
---|---|---|
Content | HTML content | |
Wiki content | ||
No options, single value | text | |
textarea | ||
single checkbox | ||
date picker | ||
date time picker | ||
user picker | ||
No options, multiple values | file upload | |
Multiple options, one selectable value | select list | |
radio group | ||
Multiple options, multiple selectable values | multi select list | |
checkbox group |
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.
See the following pages for each routine that can create an input:
- BA_createCheckboxGroup
- BA_createDatePicker
- BA_createDateTimePicker
- BA_createFileUpload
- BA_createHtmlContent
- BA_createInput
- BA_createMultiSelectList
- BA_createRadioGroup
- BA_createSelectList
- BA_createSingleCheckbox
- BA_createTextArea
- BA_createUserPicker
- BA_createWikiContent
Additional Screen Building Routines
Availability
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:
Creating the screen (up to v2.0.7 for Jira 5 and 2.6.0 for Jira 6)
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. | |
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
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)
boolean isDisabled = false; string [] 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.
Examples (v2.0.8+ for Jira 5 and 2.6.1+ for Jira 6)
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", "asdf", isDisabled, isRequired, badesc); BA_createMultiSelectList("msel", {"a", "b", "c"}, {"a", "b"}, isDisabled, isRequired, badesc); BA_createRadioGroup("radio", {"a", "b"}, "a", isDisabled, isRequired, badesc); BA_createWikiContent("h2. Wiki subtitle - TEST-2 cool :D"); BA_createSelectList("sel", {"a", "b"}, "a", isDisabled, isRequired, badesc); BA_createSingleCheckbox("cbx", true, isDisabled, isRequired, badesc); BA_createTextArea("ta", "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", isDisabled, isRequired, badesc); BA_setActionTitle("custom title for action 1"); BA_setExecuteButtonText("do not execute");