AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
321 stars 131 forks source link

Set-JiraIssue : A parameter cannot be found that matches parameter name 'Priority'. #466

Open tibereus opened 1 year ago

tibereus commented 1 year ago

I do not appear to be able to update the Priority on Task with Set-JiraIssue I can create New-JiraIssue with the -priority. Thanks

Get-InstalledModule -Name "JiraPS" = 2.14.6

tried $TicketKey | Set-JiraIssue -priority 5 -AddComment "Updated priority to Low" -SkipNotification

tried


$parameters = @{
    Priority = 5
    }
   Set-JiraIssue @parameters -Issue $TicketKey 

Returns Set-JiraIssue : A parameter cannot be found that matches parameter name 'Priority'.

For -Issue I tried both $JiraTicketObj = Get-JiraIssue $TicketList[$x] (as an object for issue) $TicketKey = $JiraTicketObj.Key (as a string) Tried 5 as string or number. Expected it to change the Priority according to ID returned by Get-JiraPriority

milesgratz commented 1 year ago

Agreed that it should be in the module, but my workaround for this was:

$issue = Get-JiraIssue -Key "XX-123"
$parameters = @{
    Fields = @{
        'priority' = @{
            'id' = '2'
            'name' = 'Critical'
        }
    }
}
$issue | Set-JiraIssue @parameters

You'll need to update the 'id' and 'name' values based on your environment:

Get-JiraPriority
tibereus commented 1 year ago

Very nice, thanks for that.

On Wed, Nov 23, 2022 at 9:02 AM Miles Gratz @.***> wrote:

Agreed that it should be in the module, but my workaround for this was:

$issue = Get-JiraIssue -Key "XX-123" $parameters = @{ Fields = @{ 'priority' = @{ 'id' = '2' 'name' = 'Critical' } } } $issue | Set-JiraIssue @parameters

You'll need to update the 'id' and 'name' values based on your environment:

Get-JiraPriority

— Reply to this email directly, view it on GitHub https://github.com/AtlassianPS/JiraPS/issues/466#issuecomment-1325392890, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3TQSEF3YDP6MZDEDCHOMYLWJZE27ANCNFSM6AAAAAAR4FBLWM . You are receiving this because you are subscribed to this thread.Message ID: @.***>