Skip to content
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

fix: timetracking field always marshalled #768

Closed
wants to merge 1 commit into from

Conversation

wbh1
Copy link

@wbh1 wbh1 commented Aug 27, 2024

Currently, the new field from #748 for timetracking is always marshalled to JSON even if the "OriginalEstimate" field is an empty string.

This is because of the way the field is initialized as a struct that will never be nil and therefore never caught by the 'omitempty' tag.

This changes the TimeTracking field to be a pointer, which is nil by default, so that if OriginalEstimate isn't set, the timetracking field won't be in the JSON sent to Jira.

This is a problem if the issue type being created is one that doesn't support a timetracking field.

Currently, the field for timetracking is always marshalled to JSON even if the "OriginalEstimate" field is an empty string.

This is because of the way the field is initialized as a struct that will never be nil and therefore never caught by the 'omitempty' tag.

This changes the TimeTracking field to be a pointer, which is nil by default, so that if OriginalEstimate isn't set, the timetracking field won't be in the JSON sent to Jira.

This is a problem if the issue type being created is one that doesn't support a timetracking field.
@wbh1
Copy link
Author

wbh1 commented Aug 27, 2024

I will look at fixing tests soon.

@ankitpokhrel
Copy link
Owner

This seems to be fixed by #767

Thank you @wbh1

@wbh1
Copy link
Author

wbh1 commented Aug 30, 2024

🤦‍♂️ I should've checked open PRs. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants