-
-
Notifications
You must be signed in to change notification settings - Fork 893
Feature: Display name field mapping #2372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature: Display name field mapping #2372
Conversation
Enable access to custom fields using readable display names in addition to field IDs. Users can access fields like issue.fields.epic_link alongside issue.fields.customfield_10001. - Add display name fields during JSON parsing in dict2resource() - Convert display names to valid Python identifiers (e.g. 'Epic Link' -> 'epic_link') - Only create mappings for fields present in API response - Maintain full backwards compatibility with existing field ID access Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
Add test coverage for display name field mapping functionality: - Unit tests for field name conversion logic - Integration tests with real JIRA data - Mock tests for controlled edge case validation - Issue-specific behavior testing - Backwards compatibility verification - Field equivalence validation Tests cover: - Basic field name conversion (Epic Link -> epic_link) - Special character handling and numeric prefixes - Name collision prevention and duplicate field detection - Empty/None value handling and missing field cache scenarios - Performance impact validation Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
# Store fields cache reference on session for display name field injection | ||
self._session.fields_cache = self._fields_cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a hack to me, but I could not find a way to access _fields_cache from resources directly, but I would love to be pointed in the 'right' way to do it.
adding a comment here for visibility -- this would be immensely useful in plenty of enterprise applications where custom fields are used in various automation purposes (such as webhooks, push events, etc, on various forges/CI systems). It is immensely painful to keep track of |
thanks a lot for the contribution, currently extension of the module though is a bit on hold until we get a grasp on the CI system and test runners . as you can see we're only testing an old version of jira datacenter. We'd really want to make sure our cloud part is up and running too before we start again with the extension with awesome functionality ... |
@derekbarbosa you're invited to do extra manual validation on this branch ... this would increase trust in the PR itself, |
I'm trying to get some basic cloud tests already up, maybe yours can be added |
@zampierilucas could you also extend the examples in the docs? |
…epic_link - Add custom field display name mapping section to docs/examples.rst - Replace deprecated epic_link examples with story_points - Update test cases to use current non-deprecated field examples Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
Hi @studioj, thanks for the feedback, I've added both the docs and updated the "Epic links" to a new field as you suggested. |
I'm prepping a branch to test more on cloud, maybe a review.and.some comments can help getting it through faster |
sorry for the delay. manual review LGTM. the self-described hack follows a similar convention to the existing trying to run the |
Summary
This PR introduces automatic display name field mapping for JIRA custom fields.
Motivation
For years, working with JIRA custom fields has been painful due to the cryptic field naming convention. When fetching issues, custom fields are returned as customfield_12345 instead of their meaningful display names like "Epic Link" or "Story Points". This forces developers to:
For example, this public JIRA issue showing the custom field structure that I have to deal with:
https://issues.redhat.com/rest/api/2/issue/RHEL-12345?expand=names
Proposed solution
This PR adds transparent display name field mapping that allows both access patterns:
Key consideration
customfields_
are still there_fields_cache
Benefits
Testing