Skip to end of metadata
Go to start of metadata

Cprime Apps has been rebranded as Anova Apps. Please note the only effect is the company name - all of our products’ names, logos, functionalities, support, etc. is exactly the same. The new location to our documentation space is https://anovaapps.atlassian.net.

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. 

CategoryInput Type

ContentHTML content
Wiki content
No options, single valuetext
textarea
single checkbox
date picker
date time picker
user picker
No options, multiple valuesfile upload
Multiple options, one selectable valueselect list
radio group
Multiple options, multiple selectable valuesmulti 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:

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.

CategoryInput TypeSIL routineParameter types
No options, single valueTEXTBA_createInput(label, defaultValue, isDisabled)

label : string

defaultValue: string

isDisabled : boolean

TEXT_AREABA_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 valuesFILE_UPLOAD (since v. 2.5)BA_createFileUpload(label, isDisabled)

label: string

isDisabled : boolean

Multiple options, one selectable valueSELECT_LISTBA_createSelectList(label, options, defaultValue, isDisabled)

label : string

options: string []

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

isDisabled : boolean

RADIO_GROUPBA_createRadioGroup(label, options, defaultValue, isDisabled)
Multiple options, multiple selectable valuesMULTI_SELECT_LISTBA_createMultiSelectList(label, options, defaults, isDisabled)

label : string

options: string []

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

isDisabled : boolean

CHECKBOX_GROUPBA_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)

Example screen script
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");?

See also

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels