AtlassianPS / JiraPS

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

Set-JiraIssue not working properly #446

Open macflurry7 opened 2 years ago

macflurry7 commented 2 years ago

When I try to use "Set-JiraIssue" cmdlet to assign one issue to one user it tells me to use accountid query. However, I tried with inserting the accountid of the user and it does not work.

Can you please guide me/fix this?

Regards

BuckcherrySpain commented 2 years ago

I have the same problem. Seem that the same thing is happening when I try to use Get-JiraUser with the -exact parameter Please, somebody found a solution for it?.

JD-LV commented 1 year ago

I got this working by beginning to modify the psm1 file: image

These references were using rest/api/2 along with an invalid query

When manually using invoke-jiramethod and rest/api/3 and resulting query, things worked.

Rogueit commented 1 year ago

I switched over to basic auth and hitting the api endpoint to get it to work

$reporter = "bob@aol.com"
$api = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
$JiraToken = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$Reporter`:$API"))
$jira_headers = @{
                    "Authorization" = "Basic $JiraToken"
                }
$url = "$JiraServer" + "rest/api/3/user/search?query=" + $reporter
$Accountinfo = invoke-restmethod -uri $url -Headers $jira_headers
$AccountID = $Accountinfo.accountid
$AccountID