Forums

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

Customer Portal : Set Default Value on User Picker Based on the Current User

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2018

Hi All, Is it possible to get the current user and set it on single user picker ? It should automatically appear on the customer portal right away after clicking on request.

 

I am using this code on behavior , server side script but it is only referring on the agent view (create , edit/view screen ) not on the portal site . Thanks!

 

import com.onresolve.jira.groovy.user.FormField
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.component.ComponentAccessor

def requestorField = getFieldByName("Affected End User")

def currentUserName = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getName()

requestorField.setFormValue(currentUserName)

0 answers

Suggest an answer

Log in or Sign up to answer