Hi, community.
I need help creating a script for the Script Runner Field which will get data from reporter user properties.
This is what I could do but it gives me an error, I would be grateful for any help.
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.UserPropertyManager
String propertyKey = 'Phone'
String propertyValue = null
UserPropertyManager userPropertyManager = ComponentAccessor.getUserPropertyManager()
User u = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
if (u) {
propertyValue = userPropertyManager.getPropertySet(issue.reporter).getString('jira.meta.Phone')
}
return propertyValue