Hello Community,
Jira S 8.6.1
Trying to get customfield by name and no method seems to work.
I see in docs that getCustomFieldObjectByName() is deprecated and now we have to use
getCustomFieldObjectsByName() but its not working.
getCustomFieldObject() + customfield_xxxxx does the job, but I'd like to get them by name, anyone knows a working way?
I want a single customfieldobject no a collection
Thank you
getCustomFieldObjectsByName() returns a collection, so you need to get one value from it. If you have only one custom field by the name that you specify, then you can simply use getCustomFieldObjectsByName("myField")[0]
Hello Payne,
First, thank you for your answer.
I am a little lost, since now its working with the single deprecated method
getCustomFieldObjectByName()
But the input parameter needs to be translated
To give you an example:
With the translated input string works...
Something has changed or I am missing something.
I've found this:
Method getCustomFieldObjectsByName() doesn't accept the right input parameter
Thank you in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas Ebert Wrote this
Fyi @Atlassian, I think the bug it due to how the internal cache in CachingCustomFieldManager is initialized: CustomFieldInMemoryStore uses CustomField::getName to populate the Map byName, and since CustomField::getName is locale-dependent on the current user, it uses that user's translated name. Which is wrong. CustomFieldInMemoryStore shouldn't use the translated name. It should use CustomField::getUntranslatedName.
I think its What is happening here.
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.