Versions Compared

Key

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

...

Note
titleUsing Post-functions in the Create transition

If you insert a Post-function (except "in the Create transition, you must make sure that you place it:

  • JIRA up to 6.4.x: after the Creates the issue originally built-in function. The exception is any post-function that writes to a system field, such as Set Field Value (with a built-in field), Set Issue Security From User's Project Role
Function", "Set Field Value to constant or Groovy expression" and "Copy Value From Field to Field Function") in the Create transition, you must make sure that you move it down to after
  • , etc.
  • JIRA 7.0.0 and above: before the Creates the issue originally built-in function in most cases.

In general, when using a post-function in the Create transition, if it doesn't work as expected, try moving it around the Creates the issue originally built-in function.

Also, please note that any field based on issue links (such as some of those created by the Tempo plugin) are not available during the Create transition (because issue links are created after the initial issue creation).

Info
titleConditional execution of post-functions

Several of the following post-functions support conditional execution, in the way of an optional Groovy expression that must return true for the function to run.

This Groovy expression can reference any field value of the current issue. Access to issue field values is achieved by the following syntax:

Code Block
issue.get("<field_ID>")

where <field_ID> is a built-in JIRA field ID (see this list) or a custom field ID (in the form customfield_nnnnn - see below for more information).

For complex conditions, you can also access the JIRA Issue object directly using the issueObject variable.

Finally, you can use the log variable to output information into atlassian-jira.log. For example:

Code Block
languagegroovy
log.error("Something went wrong");
Info
titleTo identify the custom field ID
  1. go to Administration -> Issues -> Custom Fields
  2. click on the "Configure" link for the custom field you're interested in
  3. in the URL of the Configure Custom Field page, note the number after "customFieldId=" and append it to "customfield_" to build the custom field ID

...

  • Property key: defaultAssignee
  • Property value: contains a comma-separated list of entries in the form ProjectKey -> *RoleName. *For example:  

 

TST -> Developers, JMWE -> Testers

 

For backward compatibility, the following two forms are also supported:

...

A worfklow function that sets the value(s) of a field on all issues linked to the current issue through a specified link type. The new value can be either a constant or the result of the evaluation of a Groovy expression.

Note that you can use this function to set a field of all sub-tasks by using the built-in "jira_sub_outward" link type, and of the parent issue by using the "jira_sub_inward" link type.

When using Groovy, it is possible to access both the source issue (the one that triggers the function) through the "issue" and "issueObject" variables, and the destination issue through the "linkedIssue" and "linkedIssueObject" variables (it will be evaluated once per linked issue to modify).
The "issue" object is a simple wrapper around the Issue that gives you a "get(fieldName)" method to access fields directly.
The "issueObject" is the actual com.atlassian.jira.issue.Issue object
The "log" object is a log4j logger that writes to atlassian-jira.log.

...

Info

Note that the Transition Linked Issues post-function can also be used to transition sub-tasks. You just need to select the "jira_subtask_outward" link type.

 

Note that the The transition can be specified by name, so that the transition can be found regardless of the parent issue's actual workflow, or by ID if disambiguation is required.

...