Versions Compared

Key

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

...

Variable Name

Description

issue

Access current issue. Instance of com.atlassian.jira.issue.Issue. Refer to the Atlassian documentation.

originalIssue

Access the original issue before the transition. Instance of com.atlassian.jira.issue.Issue. Refer to the Atlassian documentation.

ComponentAccessor

Access JIRA components. Refer to the Atlassian documentation.

customFieldManager

Access JIRA Custom Field Manager class. Refer to the Atlassian documentation.

loggedInUser

ApplicationUser instance for current logged-in user. See https://docs.atlassian.com/software/jira/docs/api/latest/index.html?com/atlassian/jira/user/ApplicationUser.htmlRefer to the Atlassian documentation.

Example:

loggedInUser == issue.getAssignee()

DefaultIssueChangeHolder

Default implementation of a change holder. It is It’s used to update a custom field.

aipUtils

Helper class for the post function groovy script. See Refer to aipUtils for details.

Sample Post Function configuration page

...

You can immediately execute a groovy Groovy script to see the result. This will let you write and try your groovy own Groovy scripts faster.

Please

...

remember that scripts will be actually executed

...

. If you modify anything, please use test objects (issue, asset, etc.)

...

.

Groovy examples for

...

asset Attribute

...

types

Attribute Type

Description

Groovy example

Cascading Dropdown

The value must be cascading dropdown option idsIDs. Add "-" between options. 

return "1-2"
return "1-2-3-4"

CheckboxList

Return valid option values wrapped with three @ “@” characters. i.eFor example: @@@ada@@@@@@ist@@@

For a single option value no , you don’t need to wrap with @ characters.

return "ada@@@@@@ist"

DatePicker

Result The result must be in ISO format ("yyyy-MM-dd"), i.e: . For example, "2018-12-26".

You do not need to do formatting format if you use the LocalDateTime class, as it returns in ISO format by default.

import java.time.*

LocalDateTime t = LocalDateTime.now();

return (t as String)

DateTimePicker

Result The result must be in ISO format ("yyyy-MM-ddTHH:mm"), i.e: . For example, "2018-12-26T20:20".

You do not need to do formatting if you use the LocalDateTime class, as it returns in ISO format by default.

Info

If you need to format a date to string, use the format as: "yyyy-MM-dd'T'HH:mm" (Please notice extra single quotes!)

import java.time.*

LocalDateTime t = LocalDateTime.now();

return (t as String)

DropdownList

Return a valid option value.

return "ada"

Encrypted

The value must be text.

return "password123"

InventoryList

Return reference asset ID

return "3"

InventoryListByForm

Return reference asset ID

return "10"

IP

Any text is possible, there is no format control.

return  "10.0.0.2"

IPv6

Any text is possible, there is no format control.

return "2001:0db8:85a3:0000:0000:8a2e:0370:7334"

Jira Organizations

The value must be one of Jira Organization idsIDs. If there are multiple values, you must add "@@@@@@" between them.

Tip
(

Here

is how

is how to get Jira Organization

Ids)

IDs.

return "1"

return "1@@@@@@2"

Jira Project

The value must be one of Jira Project IdsIDs. If there are multiple values, you must add "@@@@@@" between them.(

Tip

Here

is how

is how to get Jira Project

Ids)

Components IDs.

return "10000"

return "10000@@@@@@10001"

Jira Project Components

The value must be one of "Jira Project Id - Jira Project Component Id". If there are multiple values, you must add "@@@@@@" between them.(

Tip

Here

is how

is how to get Jira Project Components

Ids)

IDs.

return "10000-1"

return "10000-1@@@@@@100001-2"

Jira Project Versions

The value must be one of "Jira Project Id - Jira Project Version Id". If there are multiple values, you must add "@@@@@@" between them.(

Tip

Here

is how

is how to get Jira Project Components

Ids)

IDs.

return "10000-1"

return "10000-1@@@@@@100001-2"

Jira User Picker

The value must be a username. It doesn't need to be a Jira User.

return "tyler-durden"

RadioButtonList

Return a valid option value.

return "ist"

Text

Any text is possible.

return issue.summary

TextArea

Any text is possible.

return issue.description

URL

Any text is possible, there is no format control.

return "http://www.snapbytes.com/"

UserPicker

Any text is possible, there is no control. You may use issue.reporter.username or issue.assignee.username.

return issue.reporter.username

...