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.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
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).
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.