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?
Hi Vlad,
Short answer: not directly on the Customer Portal.
Longer, precise explanation for Jira Service Management Data Center + ScriptRunner 👇
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.
(Most common & reliable approach)
Use ScriptRunner Post-Function or Listener on Issue Created:
Customer selects a user in custom User Picker field
Request is submitted
ScriptRunner:
Reads the user picker
Gets user properties
Writes values into a custom Text Field
Field can be:
Hidden on portal
Read-only
Shown later to agents or customers
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.user.ApplicationUserdef userCf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Affected User")def textCf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("User Details")ApplicationUser user = issue.getCustomFieldValue(userCf) as ApplicationUserif (!user) returndef userManager = ComponentAccessor.userManagerdef email = user.emailAddressdef displayName = user.displayNamedef username = user.nameissue.setCustomFieldValue(textCf,"Name: ${displayName}\nUsername: ${username}\nEmail: ${email}")
📌 Works perfectly in:
Listener (Issue Created)
Workflow Post-function
ScriptRunner automation
If you only need basic properties:
Trigger: Issue created
Action: Edit issue
Smart values:
<span>{{issue.customfield_XXXXX.displayName}} {{issue.customfield_XXXXX.emailAddress}} </span>
⚠️ Limited compared to ScriptRunner (no advanced logic).
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
It looks like you're new here. Sign in or register to get started.