Assign Issue

This post-function will assign an issue based on specified logic; you can use powerful filters and conditions to assign the current issue or issue(s) related to the current issue.

Note: the Assign Issue post-function will not assign issues to inactive users. For any configuration that does not reference a specific user (e.g. round-robin assignment or assignment to group or role members) the selection of a specific user will never include inactive users; it will skip the inactive users and assign the next active user. If there are no active users available for selection, the post-function will behave as if there was no matching assignee.

Additionally, if an Assign Issue post-function is configured to assign a specific user - either through explicit assignment in the post-function or using a script - and that user is deactivated in Jira, the post-function will fail with an error.

When you add this post-function to a transition and the transition is triggered, the add-on checks the Select user field for the user or role to use for assignment, and the Assignment Behavior setting to verify that the post-function’s assignment should be utilized. The post-function will then update the Assignee of the Target Issue appropriately. Additional configurations are available to more tightly control when the post-function will execute.

Please note: This post-function replaces the Assign to role member and Assign to last role member post-functions. These post-functions will not be removed at this time, but should not be used in any new extensions. Any workflows that use the deprecated extensions should be updated to use this post-function instead.

Configure the post-function

  1. Follow the steps above to add a post-function to a Transition.

  2. From the list of post-functions, select Assign issue.

  3. Click Add.

  4. The Assign Issue page will open (Figure 1, right). Configure the post-function as needed, setting the options for user to assign, the assignment behavior, and additional options as necessary. See below for details on each of the configurations.

  5. Click Add.

Note that you need to publish the workflow for the new post-function to take effect.

Select User

The Select user options set the logic to utilize to determine which user should be assigned the issue. The options are:

  • Select user - Select the user (or a role to which the user belongs) who will be assigned the issue. The options are:

    • Current user - The user who triggered the transition.

    • Reporter - The user value of the Reporter field for the issue.

    • Project Lead - The project lead for the project to which the issue belongs.

    • Default assignee for project - The user set as the default assignee for the project to which the issue belongs.

    • User who last commented

    • By username - Manually select a specific user (see User field, below).

    • Component lead - The user set as the lead for the selected Component (see Component field, below).

    • User from user object field - The user value from the selected field (see Field field, below).

    • Last role member - The previous role member who was assigned this issue.

    • Role member - Select the Role to which the user belongs as well as the Multiple user options to determine which specific user should be assigned (see Role and Multiple user options, below).

    • User returned from script - Enter a Groovy script that returns the user value for the assignee.

  • User - Only visible when Select user is set to ‘By username’. Enter the name of the user to whom the issue should be assigned.

  • Component - Only visible when Select user is set to ‘Component lead’. Select the required Component.

  • Field - Only visible when Select user is set to ‘User from user object field’. Select the required user object field.

  • Role - Only visible when Select user is set to ‘Last role member’ or ‘Role member’. Select the required role to which the user belongs.

  • Multiple user options - Only visible when Select user is set to an option that may return multiple users, such as ‘User from user object field’, ‘Role member’, and ‘User returned from script’. When a specific role is selected for assignment, that role may have multiple users assigned to it; the options sets which user within that set will be assigned to the issue. The options are:

    • Assign to the first matching user in alphabet order - The first user in alphabetical order, by display name. Please note: this is case sensitive.

    • Round-robin assignment - Only visible when Select user is set to ‘Role member’. For each project, JMWE stores a list of users who have been assigned any issue by any Assign issue post-function that is configured to use a round-robin assignment. The Assign issue post-function will cycle through that list and assign the issue to the next user in the round.

    • Assign to the least busy matching user - The user who has the least number of assigned tickets without resolution.

    • Assign to a randomly selected user

    • Specify the user with a custom script

      • Assignment script - Enter a Groovy expression that will return a user value.

  • Use values from the transitioned issue - Only visible when Select user and Which issue(s) are set in specific combinations. See Note, below. Use the Assignee value from the issue that triggered the post-function; otherwise, the post-function will use the Assignee value from the target issue.

  • Throw an exception if no user matches the specified criteria - Check this option to cause the extension to throw an error if no user is determined with the configured behavior.

Assignment behavior

The Assignment behavior field determines whether or not the post-function will execute. If the behavior condition returns false, the post-function will not execute and the assignment of the issue will not be changed.

The options are:

  • Always - The post-function will always execute and assign the issue as configured.

  • If transition user value is “Automatic” - If the issue assignment is set to “Automatic” in the creation screen, or in a transition screen, the post-function will execute and assign the issue as configured.

  • If the transition user value is not changed - If the issue assignment has not been changed in the transition screen and it is not set to “Automatic”, the post-function will execute and assign the issue as configured.

  • If transition user value is NOT a member of the selected role - Only visible when Select user is set to ‘Last role member’ or ‘Role member’. If the assigned user in the transition screen is not a member of the role selected in the Role field (see above), the post-function will execute and assign the issue as configured.

Target Issues

Error Handling

Conditional Execution

In addition to the Assignment behavior settings, it is possible to configure the post-function to execute (or not execute) only in specific circumstances. The Condition execution options set these behaviors.

The options are:

  • Only if condition is true - Check this option to execute the post-function based on the result of a groovy expression. See Conditional execution/validation using a Groovy expression for more information.

    • Condition - Enter a Groovy expression that evaluates to true or false (or truthiness/falseness).

  • Skip this post-function if another JMWE Assign Issue post-function in this transition has set an assignee - Check this option to bypass the post-function if another earlier Assign Issue post-function has already set an assignment successfully.

On This Page

Figure 1 - Assign Issue post-function