Advanced ASRDisplay attributes

ScriptRunner ASRDisplay attributes and parameters

Multiline

The size of the input field, for parameters from type String, can be changed and a scrollbar appears. This functionality is only guaranteed with our recommended web browsers.

Example:

 [Parameter(HelpMessage="ASRDisplay(Multiline)")] 

Password

Ensures masked input.

Example:

 [Parameter(HelpMessage="ASRDisplay(Password)")] 

DateTime

It is possible to choose between three DateTime options.

  1. DateTime
    - Return is a parameter of type DateTime
    - Selection of date and time
    - ASRDisplay is not needed
    - DateTime picker with the transfer as ISO string (UTC)
  2. DateTime with attribute

    - Return is a parameter of type DateTime
    - Selection of date
    - Date picker with transfer  'yyyy-MM-dd' (local)

    Example:

    [Parameter(HelpMessage="ASRDisplay(Date)")]
  3. String with attribute
    - Return is a parameter of type string
    - Transfer to parameter
    - Date picker with transfer 'yyyy-MM-dd' (local)

    Example:
    [Parameter(HelpMessage="ASRDisplay(Date)")]

Splatting

With a single query, multiple attributes or properties of an object can be determined and passed to the main script. Propagate properties from the returned Hashtable directly to same-name script parameters.

Example:

[Parameter(HelpMessage="ASRDisplay(Splatting)")]

Best Practice: Alias

Use Alias to merge Properties from the same Query.

Example:

[Parameter(HelpMessage='ASRDisplay(Alias=attribute_name)')]

Example Splatting & Alias:

param(

[Parameter(HelpMessage="ASRDisplay(Splatting)")]
[hashtable]$UserObject,

[Parameter(HelpMessage='ASRDisplay(Alias=UserObject.givenName)')]
[string]$firstname,

[Parameter(HelpMessage='ASRDisplay(Alias=UserObject.sn)')]
[string]$lastname

)