Closed Growlert closed 4 years ago
I have the same issue using Get-JiraIssue -Query "project in (ITHD) AND status != Closed AND status != Resolved AND status != Done AND status != Canceled ) ORDER BY assignee, priority DESC, updated DESC" | select key, assignee, duedate, updated, created, summary, components. This is in a daily email script that just started acting up on Feb 13th.
We see exactly the same issue..
PS J:\Powershell\Functions> Get-Module JiraPS -ListAvailable | Select Name, Version
Name Version
---- -------
JiraPS 2.12.5
JiraPS 2.9.0
PS J:\Powershell\Functions> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.18362.628
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.628
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
yea, same issue here.
Get-Module JiraPS -ListAvailable | Select Name, Version
Name Version
JiraPS 2.12.5 JiraPS 2.9.0
Same here!
JiraPS 2.12.5
Name Value
---- -----
PSVersion 5.1.18362.628
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.628
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1```
The changes in the api of the cloud are not that trivial. And to make matter worse, the changes do not apply to jira server. Deprecation notice and migration guide for major changes to Jira Cloud REST APIs to improve user privacy
I got a few things working again. But it's not yet finished: https://github.com/lipkau/JiraPS/commit/a8a31883bacb4efee0657976c71b9d560b0ae41d
In the case of creating a new issue the line that fails is here:
https://github.com/AtlassianPS/JiraPS/blob/master/JiraPS/Public/New-JiraIssue.ps1#L100
Can it become somethign like:
$user=$(Get-JiraUser -Credential $Credentia)
If ([string]::IsNullOrEmpty($user.Name)) {
$requestBody["reporter"] = @{"accountId" = "$user.AccountId"}
} Else {
$requestBody["reporter"] = @{"name" = "$user.Name"}
}
Get-JiraUser returns blank Name for all users. Please fix it ASAP.
@vyacheslav-shcherbak-globallogic-com I don't think that will happen, JIRA remove that field from the API. This is just a wrapper for the API.
@vyacheslav-shcherbak-globallogic-com I don't think that will happen, JIRA remove that field from the API. This is just a wrapper for the API.
Will it possible to reassign a Jira issue to an another user in another way while this functionality does not work? When are you going to fix it? Can somebody to rewrite this to use AccountId instead of Name, eg.
Set-JiraIssue -Issue $IssueKey -Assignee (Get-JiraUser -UserName "$($UserName)").AccountId -Credential $Cred
instead of this
Set-JiraIssue -Issue $IssueKey -Assignee (Get-JiraUser -UserName "$($UserName)") -Credential $Cred
Set-JiraIssue -Issue $IssueKey -Assignee (Get-JiraUser -UserName "$($UserName)").AccountId -Credential $Cred
Not working. It throws me the error: Invoke-JiraMethod : Specified user does not exist or you do not have required permissions
For those of you looking for a workaround, I think this will do the trick:
$assignTo = "BigHouseITGuy"
$jiraUserData = get-jirauser -UserName $assignTo -exact | Select-Object *
$accountIdObject = [pscustomobject]@{
accountId = $jiraUserData.accountId
}
$fields = @{
'assignee' = $accountIdObject
}
Set-JiraIssue -Issue $issue.key -Fields $fields
This also works for reporter.
Thanks BigHouseITGuy. Your solution works like a charm! You saved a lot of manual work!
Thanks @BigHouseITGuy . Your solution with small changes works for me too!
@vyacheslavshcherbak I am not involved with this project, just a user like you who tried to debug this issue.
Thank @BigHouseITGuy. That workaround was really helpful!
Description
Seems like something is broken on the Jira side yesterday. I'm not able anymore to get issue assignee by name or set it, the property "name" of assignee is now empty.
Steps To Reproduce
(Get-JiraIssue "issue_key").assignee.name
returns nothingSet-JiraIssue -Issue "issue_key" -Assignee "user_name"
returns no error, but nothing assignedExpected behavior
Should work as expected
Screenshots
Your Environment
Possible Solution