Set assignee based on a former assignee

Use case

Store the last assignee in a status in a hidden User Picker field and update the Assignee field with it in a posterior transition.

This use case requires the implementation of two Update or copy field values post functions in two different transitions.

Prerequisites

Set up a custom field

Create a User Picker (single user) custom field and name it Last Assignee In Status

Restrict its context to the desired projects.

Do not add it to any screen! It will be used internally.

🛠️ Configuration

Add the Update or copy field values post function to the transition or transitions that leave the status in question.

Target issue

Choose Current issue

Field

Choose Last Assignee In Status

Value

Choose Set field value manually

Expression

Use the following expression with the expression editor in Advanced text mode.

Bash
hasChanged(%{issue.assignee}) = true ? previousValue(%{issue.assignee}) : %{issue.assignee}

Add the Update or copy field values post function to a posterior transition.

Target issue

Choose Current issue

Field

Select Assignee

Value

Choose Copy field value from current issue and select the field Last Assignee In Status

Conditional execution

Restrict the usage of the post function with the following conditional execution. Replace the field code with the appropriate one for the field Last Assignee In Status before using it.

Bash
%{issue.cfaaaaa} != ""
Use case Workflow function Parser functions
Prioritize the issues globally

Update or copy field values

indexOf() previousValue() issuesFromJQL()

Automatically fill an insight custom field after a transition

Update or copy field values

Create an internal Service Management comment on linked issues

Update or copy field values

Set a date on the same week day on alternate weeks

Update or copy field values

addDays() nextDayOfTheWeek() modulus() weekOfTheYear() datePart()

Set a Date Picker field to the nth day of the month

Update or copy field values

dayOfTheMonth() lastDayOfTheMonth() addDays()

Set the next fix version

Update or copy field values

floor() toNumber() substring() length()

Set fix version based on its start and release date

Update or copy field values 

toString() textOnStringList() unreleasedVersions() startDates() releaseDates() first()

Set Due Date with latest value among sub-tasks

Update or copy field values

fieldValue()

max()

siblingSubtasks()

Assign important issues to the project lead

Update or copy field values

Shorten the summary to a maximum number of characters

Update or copy field values

substring() length()

Match several values of a list

Update or copy field values

toString() distinct() filterByPredicate()

Assign issue to current user

Update or copy field values

Keep parent issue's priority in sync

Update or copy field values

Set assignee based on a former assignee

Update or copy field values

previousValue()

Add watchers ignoring inactive users

Update or copy field values

usersInGroup() isActive() toString() filterByPredicate()

Add days skipping weekends and holidays to a Date Picker field

Update or copy field values

addTime()

Keep track of important status updates

Update or copy field values

Fields required or changed

dateTimeToString()

Change the assignee to the next evaluator

Update or copy field values

first()

toStringList()

Add or remove request participants

Update or copy field values