-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Help With Custom Fields #61
Comments
Take a look at #56 - there's some syntax quirks when your field only allows specific values. Basically, you'll want something like this: $field = @{
'customfield_11154' = @{
id = '14750' # Production
# You *might* also be able to do this with value = "Production" instead...not sure on that one
}
}
Set-JiraIssue -Issue $JiraIssue -Fields $field This is on my radar as something that needs to be documented better, but I haven't had much time lately. |
I created the PR https://github.com/replicaJunction/PSJira/pull/59 exactly for that reason. |
What about a customfield with labels?
What I have tried is this: Error is:
|
Based on the error description, I would try: |
That worked, thanks! |
Since this worked out so well, I have another one. From Get-JiraIssueCreateMetadata:
It's no problem setting just the main field, but how to get the allowed values for the child-field, and how to set them? |
What is the metadata for the child fields? |
Where can I find it? It's not a separate custom field. customfield_14662@{self=https://jira.internal.com/rest/api/2/customFieldOption/20140; value=Windows; id=20140; child=} |
Give this a try. I'm guessing a little bit here, but I think this will work: $field = @{
'customfield_14662' = @{
id = '20140'
child = @{
value = '2008 R2
}
}
}
# Add other params like reporter, priority, etc.
New-JiraIssue -Fields $field |
Works perfect! Thanks! |
Hi,
First of all nice work, this module saves me time.
But i have a question about Set-JiraIssue
I want to update a custom field but this custom field is a dropdown field how do i update this?
field is called "Environment Sx" (customfield_11154)
Possible values: Production, Test, Acceptance, Development
I tried the following commands but that did not work:
Current value of that field is Development or id 14753 and i want to update it to production or id 14750
Set-JiraIssue -Issue $JiraIssue -Fields @{'Environment Sx' = 'Production';}
Set-JiraIssue -Issue $JiraIssue -Fields @{'Customfield_11154' = 'Production';}
Set-JiraIssue -Issue $JiraIssue -Fields @{'Customfield_11154' = '14750';}
14750 = Value Production
But the result of all the commands are the same: WARNING: JIRA returned HTTP error 400 - BadRequest
It is possible to get the current value:
$JiraIssue.customfield_11154
returns:
Is custom field with dropdown not supported or is my code wrong?
The text was updated successfully, but these errors were encountered: