Allow fields to be filtered by id only in Get-JiraField (mainly for use in Set-JiraIssue) #476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a fix for a situation I have encountered, where someone created a field with a duplicated name, which then caused Set-JiraIssue to be unable to set a value for previously existing field, since Get-JiraField returned two values, while only one of the fields were present in the issue I was updating, resulting in "Field 'xxx' cannot be set. It is not on the appropriate screen, or unknown." error. Added switches to Get-JiraField and Set-JiraIssue that allow user to call the fields directly by their id's, which allows to bypass this issue.
Motivation and Context
Fixes issue with updating field value in an issue, in a case when multiple fields of the same name exist, but are not present in this issue.
Types of changes
Checklist