Jira user property based on the user name entered

Hi,

I have a requirement to display user property (eg: Phone no) based on the employee name (this is another custom field) entered in the create issue screen. I tried to use Jira ToolKit plugin to retrieve the user property, the user property is retrieved but its not getting displayed in the create issue screen,its displayed in the view issue screen. I need to display the phone number as soon as the employee name is entered in the create issue screen. Could any one please suggest me a solution to it.

Thanks,

Anu.

3 answers

1 accepted

This widget could not be displayed.

Try out doing this using the JIRA Behaviours plugin https://jamieechlin.atlassian.net/wiki/display/JBHV/JIRA+Behaviours+Plugin

Thanks for the reply. I tried out behaviour plugin as well. In behaviour plugin I can retrieve the user properties of the logged in user, as per my requirement the login user may be different from the value entered in the Employee Name custom field. I need to retrieve the user properties of the Employee Name which will be entered in the create issue screen, once the Employee Name is entered the phone number of the employee (stored in user propertied) need to be displayed. Please suggest me whether Behaviour plugin helps to retireve the user property dynamically based on the value entered.

Thanks,

Anu.

This widget could not be displayed.
Mizan Community Champion Apr 29, 2014

Hi Anuradha ,

You can try this plugin developed by me https://marketplace.atlassian.com/plugins/com.mizan.buzz

This widget could not be displayed.

Thanks Boris Georgiev, you are correct. I'm able to get the employee leave balance dynamically based on the employee name entered with the help of behaviour plugin.

This script helped me to achieve my requirement.

import com.atlassian.jira.ComponentManager

import com.atlassian.jira.user.UserPropertyManager

import com.opensymphony.module.propertyset.PropertySet;

import com.atlassian.jira.user.ApplicationUsers;

ComponentManager componentManager = ComponentManager.getInstance()

UserPropertyManager userPropManager = componentManager.getUserPropertyManager()

FormField empname = getFieldById(fieldChanged)

if(empName.getValue().length()>1)

{

PropertySet propertySet = userPropManager.getPropertySet(ApplicationUsers.byKey(empName.getValue()));

FormField leaveBalanceformField = getFieldByName("Available Medical Leave Balance1")

leaveBalanceformField.setFormValue(propertySet.getString("jira.meta.Medical Leave Balance"))

}

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

203 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you