JiraPS icon indicating copy to clipboard operation
JiraPS copied to clipboard

Set-JiraIssue not working properly

Open macflurry7 opened this issue 4 years ago • 3 comments

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

macflurry7 avatar Sep 20 '21 18:09 macflurry7

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?.

BuckcherrySpain avatar Mar 07 '22 17:03 BuckcherrySpain

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.

JD-LV avatar Mar 08 '23 22:03 JD-LV

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

$reporter = "[email protected]"
$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

Rogueit avatar Mar 09 '23 18:03 Rogueit