Hi,
i get the additional properties of a user/reporter in the normal way like
import com.atlassian.jira.component.ComponentAccessor
def userPropertyManager = ComponentAccessor.userPropertyManager
def reporter = issue.getReporter()
def reporterProp = userPropertyManager.getPropertySet(reporter).getText("MY_PROPERTIE")
Is there a HAPI Way to do this?
Maybe like this ?
Issues.getByKey('ABC-01').reporter.getProperties('MY_PROPERTIE')
Hey..
Not currently, but we can add that in. Easy access to user and issue properties sounds like a good suggestion. I've added a placeholder ticket here https://productsupport.adaptavist.com/browse/SRJIRA-6713 which you can watch.
cheers, jamie
Hello @Alexander Mateasik ,
Welcome to the community.
I do not see a way to get a property by key.
Issues.getByKey('ABC-01').reporter.properties returns a Map so one can get values off the map with the key
def value = Issues.getByKey('ABC-01').reporter.properties.get('KEY'
You can check what keys are available in the script console with
return Issues.getByKey('ABC-37').reporter.properties.keySet()
//returns in my instance [ID_COMPARATOR, key, user, bridgedUser, id, active, class, directoryId, directoryUser, displayName, emailAddress, name, username]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a bit different... `.properties` in this case is `org.codehaus.groovy.runtime.DefaultGroovyMethods#getProperties` which will list all the "properties" of the object, but in the java sense of the word properties, rather than in the sense of `com.opensymphony.module.propertyset.PropertySet` which I believe Alexander is talking about.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.