Post-functions

 

1 - Assign to role member (new in 1.2, updated in 3.0.1)

A worfklow function that assigns the current issue to the default member of the specified project role.

Since JIRA does not support the notion of a default member for project roles, the Assign to role member function identifies the default member of a project role by going through all the members of the project role looking for a User Property with the following two characteristics:

  • 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:

  • Property Key: {ProjectName}x{RoleName} (for example: CoolProjectxQAMembers)
  • Property value: "default" (without the quotes)

Or: (since 1.5.3)

  • Property Key: defaultAssignee{n}  (where n is a number from 1 up, for example: defaultAssignee1)
  • Property value: {ProjectName}x{RoleName} (for example: CoolProjectxQAMembers)

If no such member is found, the first member of the project role is used instead.

This can be used for scenarios like: "when a developer resolves the issue, assign the issue to the QA lead".

2 - Assign to last role member (new in 1.2) (updated in 1.5.1, 2.4.1 and 3.0.1)

A worfklow function that assigns the current issue to the latest Assignee (excluding the current one) who is a member of the specified project role.

When the function is executed it goes backwards through the change history of the issue. When it finds a user that belongs to the specified role, it assigns the issue to that user. Optionally, it can consider the Reporter and/or the Current Assignee in addition to previous assignees.

This can be used for scenarios like: "when QA fails assign the issue to the last developer who worked on it".

3 - Set Field Value to constant or Groovy expression Function (new in 3.1)

A worfklow function that sets the value(s) of a field to either a constant or the result of the evaluation of a Groovy expression.

When using Groovy, it is possible to access the issue (the one that triggers the function) through the "issue" and "issueObject" variables:

  • The "issue" object is a simple wrapper around the Issue that gives you a "get(String fieldName)" method to access fields directly (see the panel on "Conditional execution of post-functions" at the top of the page for details)
  • The "issueObject" is the actual com.atlassian.jira.issue.Issue object
  • The "log" object is a log4j logger that writes to atlassian-jira.log.

The return value of the script can be:

  • on object of the type expected by the field being set
  • a String that will be converted, if possible, to the type expected by the field being set
  • an array of String (String[]) that will be converted to a Collection of values of the type expected by the field being set

4 - Increase value of field Function

A workflow function that increases the value of a numerical field by one.

5 - Set field value from User Property value Function

A workflow function that sets a field to the value of a User Property.

A typical use is to store the country, or department, or other such information, of the Reporter of an issue into the issue itself (so that it can be displayed, searched, or used by the workflow).

When setting the Issue Security field, the user property must contain the numerical id of the Issue Security Level, which you can find by looking at the links associated with the Add/Default/Delete operations on the desired Security Level (on the Edit Issue Security Levels screen).

6 - Copy Field Value to Parent Function (new in 1.3.2)

A worfklow function that copies the value(s) of a field into the same field of the issue's parent issue.

7 - Set Field Value From Parent Function (new in 2.4)

A worfklow function that sets a field value to the value(s) of the same field of the issue's parent issue.

8 - Copy Field Value to Linked Issues Function (new in 3.0)

A worfklow function that copies the value(s) of a field into the same field of all issues linked to it through a specified link type.

Note that you can use this function to copy a field from an issue to its sub-tasks by using the built-in "jira_sub_outward" link type.

9 - Set Field Value From Linked Issue Function (new in 3.0)

A worfklow function that sets a field value to the value(s) of the same field of an issue linked to it through a specified link type.

10 - Set Field Value Of Linked Issues Function (new in 3.1)

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.

11 - Copy Value From Field to Field Function (new in 2.3)

A workflow function that copies the value(s) of a field to another field of the same issue. It can optionally take the source value as it was before the transition (useful in case the user modified the source field during the transition screen). Since 2.4, it can also optionally merge multi-valued field values instead of replacing them.

12 - Add Field Value to Parent Function

A worfklow function that adds the value(s) of a multi-valued field (such as Fix version(s)) into the same field of the issue's parent issue.

13 - Set Issue Security From User's Project Role Function (new in 1.5)

A worfklow function that sets the issue security level based on the Project Role to which the current user belongs. This function can be used on the Create transition to set a different issue security level depending on whether the issue is being created by an internal user or by an external user (e.g. a customer).

 

To use this workflow function in the "Create Issue" transition, you must place it before the "Creates the issue originally" step.

14 - Transition Issue (new in 3.5.2)

A workflow function that triggers a named transition on the current issue. This can be used to move the current issue one step further in the workflow, if a condition is fulfilled.

Note that 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.

15 - Transition Parent Issue (new in 2.1)

A workflow function that triggers a named transition on the parent issue of the current sub-task.

Note that 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 (since 2.4).

16 - Transition Linked Issues (new in 3.1.1)

A workflow function that triggers a named transition on issues linked to the current issue through a specified link type.

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.

17 - Comment Issue (new in 3.3)

A workflow function that creates a Comment on the current issue. The text of the comment can be either a fixed text, or the result of the evaluation of a Groovy expression.

When using Groovy, it is possible to access the issue through the "issue" and "issueObject" variables.
The "issue" variable is a simple wrapper around the Issue that gives you a "get(fieldName)" method to access fields directly.
The "issueObject" variable is the actual com.atlassian.jira.issue.Issue object

18 - Comment Linked Issues (new in 3.6)

A workflow function that creates a Comment on linked issues. The text of the comment can be either a fixed text, or the result of the evaluation of a Groovy expression.

When using Groovy, it is possible to access the issue through the "issue" and "issueObject" variables, and each linked issue through the "linkedIssue" and "linkedIssueObject" variables.
The "issue" variable is a simple wrapper around the Issue that gives you a "get(fieldName)" method to access fields directly.
The "issueObject" variable is the actual com.atlassian.jira.issue.Issue object