I'm trying to retrieve a table of Jira issues using PowerShell.
I'm using the syntax below and that works for everything except the custom field, which is empty.
$Results | Select-Object -Property summary,Key,ID,status,Project,Assignee,customfield_12300, Created, resolutiondate,duedate,resolution,labels
Furthermore, I only want the value of this field, not the entire contents (which I'm not getting anyway).
customfield_12300 : @{self=https://jiratest.corp.docusign.com/rest/api/2/customFieldOption/17903; value=Orange; id=17903; disabled=False}
Is this possible to do with PowerShell (JiraPS)? I'm running version 2.1.6 of JiraPS.
Nevermind, I figured it out on my own. If anyone is interested, this is the syntax I used.
This is a bit less compact than yours, but it does the name translation dynamically,
# Get a map of custom fields for translation/rename
$customFields = Get-JiraIssueCreateMetadata -Project $JiraProjectKey -IssueType 'Task' | ?{$_.Id -like "customfield_*"}
$issues = Get-JiraIssue -Query "project = '$JiraProjectKey' AND created >= -5d"
foreach($issue in $issues)
{
foreach($cf in $customFields)
{
if($issueField = $issue.psobject.Properties[$cf.Id])
{
$issue | Add-Member -NotePropertyName $cf.Name -NotePropertyValue $issueField.Value
$issue.PSObject.Properties.Remove($cf.Id)
}
}
$issue
}
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.