In Edit Issue Action, I want to set an Issue's Custom Field to the value stored in the Reporter's JIRA User Properties field. I know how to reference a Custom Field. But how can I reference a JIRA User's Property?
For example: User King Duke, has a property "customerid" set to 1234. I would like to use that value to set the Issue's Customer field to 1234.
image2016-7-18 18:18:56.png
Basically, we're using JIRA Service Desk to handle Requests from customers. I would like to automatically assign the Issue's Customer field based on the reporter. And customers would like their respective teams to be able to view each others' Requests. Therefore, based on the Reporter value, I would like to automatically set the Issue's Customer (a custom field for Issue) and Participants. The plugin Teams for JIRA Service Desk may accomplish all of this already. However, until we get approval for that plugin, we're trying to get an interim solution via JIRA Automation Plugin.
Nice and extensive search for solution
I do not think it will work out of the box. The only thing which 'might' work without coding is using the "User Properties via JIRA Toolkit". Then you may be able to read a user property as a custom field (not sure if it will work as expected though, you'll need to test).
You can obviously extend the EditIssueAction source code (or add a new action) with necessary logic if you are familiar with JAVA.
Last option might be that you will use Groovy Script Runner to script the change you need (I am not sure if it supports UserPropertyManager).
I think access to the User Properties requires class (import com.atlassian.jira.user.UserPropertyManager) which is not imported in the JIRA Automation Plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I’ve tried to see if I can get to the value from tables or REST API, just to understand if there is a special column/property name. But not sure where that would lead me.
I’ve tried various properties and calls based on reading some other postings, but that hasn’t helped either.
If there aren’t any calls/methods to retrieve that value, then is JIRA Toolkit Plugin the intermediate answer?
JIRA Toolkit Plugin mentions
User Property Field | A read-only custom field that displays a user property. |
If that plugin were installed in our environment, would that make the User Properties accessible via Velocity Context aka JIRA Automation Plugin?
Wanted to ask before trying, just in case.
Based on this
https://answers.atlassian.com/questions/151905/what-database-table-keep-user-properties
It’s stored in a table of course, but how can that be accessed via JIRA Automation Plugin (Velocity Context)
Info. accessible via REST API Based on this
REST API Documentation (for our version of JIRA)
REST API Example URL and Parameter (JIRA docs)
Tried this
http://example.com/rest/api/2/user/properties?username=kingduke
FAIL, gives this only
{"keys":[]}
Based on this
Tried this
$userPropertyManager.getPropertySet($issue.reporter).getString("customerid") FAIL
Based on this
Tried these
$issue.reporter.UserPropertyManager.getPropertySet() FAIL
$issue.getCustomFieldValue($customfield)
This is also the thread that recommended JIRA Toolkit.
Based on this
Tried these
$UserPropertyManager#getPropertySet(User).get("Phone")
$UserPropertyManager#getPropertySet(User).get("customerid") FAIL
$UserPropertyManager#getPropertySet($issue.reporter).get("customerid") FAIL
$UserPropertyManager.getPropertySet($issue.reporter).get("customerid") FAIL
$getPropertySet($issue.reporter).get("customerid") FAIL
Based on this
https://answers.atlassian.com/questions/35780988/can-i-report-based-on-user-properties
Tried these
$issue.reporter.displayname - fail
$issue.reporter - pass, kingduke(abc@gmail.com)
$issue.reporter.displayName - pass, King Duke
$issue.reporter.name - pass, kingduke
$issue.reporter.emailAddress - pass, abc@gmail.com
$issue.reporter.properties - fail
$issue.reporter.property - fail
$issue.reporter.customerid - fail
$issue.reporter.properties.keys - fail
$issue.reporter.properties.customid - fail
$issue.reporter.getDisplayName() - pass, King Duke
$issue.reporter.getPropertySet() - fail
$issue.reporter.getEmail() - fail
$issue.reporter.getEmailAddress() - pass, abc@gmail.com
$issue.reporter.getNumberOfReportedIssuesIgnoreSecurity() - fail
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.