Fix "User is not valid" Automation errors by removing inactive Jira users

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

In Jira Data Center, you might find errors in automation executions for issues that use a user picker field. For example:

User '<SOME_USERNAME>' is not valid for this user picker. (customfield_XXXXX)

This is caused by a multi-user picker custom field with inactive users still available as options. This automation rule is here to help you efficiently remove inactive users from your multi-user picker custom field.

Environment

Jira Data Center 9.12.X,10.3.X

Solution

Automation rule to remove inactive users from user field

Let's assume we want to remove any inactive users from the Approvers field.

  1. Go to ⚙️ → System → Automation rules

  2. Create an automation rule

  3. Choose a rule trigger that matches your needs

    • There is a bug with the Issue created trigger and this rule: JIRAAUTOSERVER-589

    • We'll use the "Issue commented" trigger as a workaround

  4. Add Create variable:

    • Variable name: varInactiveUsers

    • Smart value: {{#issue.Approvers}}{{#if(not(active))}}{{name}},{{/}}{{/}}

  5. Add Edit issue, and select Additional fields:

    • Add the following JSON code in the Additional fields box:

    • { "update": { "Approvers": [ {{#if(exists(varInactiveUsers))}}{{#varInactiveUsers.substringBeforeLast(",").split(",")}}{"remove": {"name":"{{.}}"}}{{^last}}{{/}}{{/}}{{/}} ] } }

The above rule will remove Inactive users from the Approvers list in the multi-user picker custom field. Execute the rule based on your chosen trigger type - in our example, commenting on an issue will trigger the rule.

Updated on May 22, 2025

Still need help?

The Atlassian Community is here for you.