Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get user properties from custom user picker field

Vlad Fed
February 18, 2025

Hello.
We have Jira Service Management Data Center.
Is there a way with Scriptrunner get user properties from custom user picker field and put to custom text field in customer portal?

1 answer

0 votes
Pavel Junek
Community Champion
January 20, 2026

Hi Vlad,

 

Short answer: not directly on the Customer Portal.

Longer, precise explanation for Jira Service Management Data Center + ScriptRunner 👇


Why this is limited on the Customer Portal

In JSM Customer Portal:

  • ScriptRunner Behaviours do NOT run

  • ❌ No dynamic Groovy execution on field change

  • ❌ You cannot react to a User Picker change in real time

  • ✅ Only server-side processing after submit is possible

So you cannot dynamically read a User Picker field and immediately populate another text field while the customer is filling the portal form.

This is an Atlassian limitation, not ScriptRunner.


What is possible (recommended solutions)

✅ Option 1: Populate the text field after request is created

(Most common & reliable approach)

Use ScriptRunner Post-Function or Listener on Issue Created:

  1. Customer selects a user in custom User Picker field

  2. Request is submitted

  3. ScriptRunner:

    • Reads the user picker

    • Gets user properties

    • Writes values into a custom Text Field

  4. Field can be:

    • Hidden on portal

    • Read-only

    • Shown later to agents or customers

Example (Groovy – DC compatible)

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser

def userCf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Affected User")
def textCf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("User Details")

ApplicationUser user = issue.getCustomFieldValue(userCf) as ApplicationUser
if (!user) return

def userManager = ComponentAccessor.userManager

def email = user.emailAddress
def displayName = user.displayName
def username = user.name

issue.setCustomFieldValue(
textCf,
"Name: ${displayName}\nUsername: ${username}\nEmail: ${email}"
)

📌 Works perfectly in:

  • Listener (Issue Created)

  • Workflow Post-function

  • ScriptRunner automation


✅ Option 2: Use Automation for Jira (no code)

If you only need basic properties:

  • Trigger: Issue created

  • Action: Edit issue

  • Smart values:

    {{issue.customfield_XXXXX.displayName}} {{issue.customfield_XXXXX.emailAddress}}

⚠️ Limited compared to ScriptRunner (no advanced logic).


⚠️ Option 3: Portal-only workaround (UI trick)

If the goal is display only, not storing:

  • Use request form instructions

  • Or duplicate fields:

    • One user picker (visible)

    • One text field (hidden, auto-filled later)

Still not dynamic on portal.

 

Pavel

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events