Hi,
We have written one dropdown list name['EMployee']. In Employee Field there are 4 employee name ex{john, mark, sham, george}. Suppose we select 'mark' in dropdownlist. Then how should i get value of this field using groovy script?. We need 'mark' string value.
Can any one help us. we are using 7.3.0 jira version. Thanks in advance.
Depends on where you're running the code, but assuming it's a post-function which provides "current issue" for immediate use, then
def myCf = customFieldManager.getCustomFieldObjectByName("EMployee")
def cfValue = issue.getCustomFieldValue ( customField )
And then, as you will have had options returned, cfValue.getName() for it as a string.
Hi Nic Brough,
Yes we are using Post function. we have tried 'cfValue.getName()' but it is showing error.
Attached screenshot please check and let me know where is the mistake in my code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using which add-on? ScriptRunner? JMWE?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.