Versions Compared

Key

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

...

This guide explains how to configure the [AIP] - Create Asset workflow post function to automatically create new assets in Jira when specific workflow transitions occur and, optionally, attach to the current issue.

...

Parameter

Description

Condition 1

Groovy script for the post function condition. The function must return true, or condition must be empty to pass. If the condition fails, the post function will be ignored.

Condition 2

Asset custom field value must be empty before the transition.

Link to issue

Set newly created asset to asset custom field.

Target Asset custom field

Specify the custom field to link the asset.

Asset Type

Type of asset to create.

Attributes (optional)

Target attribute to set its value.

Context parameters for Groovy

...

scripts

This table details the available context parameters you can leverage within your scripts. Please see Sample Groovy Scripts to Create/Update Asset workflow post functionscripts for asset management in Jira workflows for more examples.

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 Jira components. Refer to the Atlassian documentation.

customFieldManager

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

loggedInUser

ApplicationUser instance for current logged-in user. Refer to the Atlassian documentation.

Example:

loggedInUser == issue.getAssignee()

DefaultIssueChangeHolder

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

aipUtils

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

Sample Post Function configuration page

...