You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
After a recent upgrade to our development environment, I can no longer create tickets via powershell using JiraPS.
I'm still able within our production environment fine, however when I attempt to create the ticket via "New-JiraIssue", I get an error: "Invoke-JiraMethod: Issue Does Not Exist"
However the issue does exist under the project...
I don't think it's permissions as I can query and retrieve data using the Get-JiraIssue query command with no issue.
Any ideas/ suggestions would be appreciated.
Thanks
James
I ran into this, it appears to be related to Jira changing the API in version 9. See the open issue below on the JiraPS github:
https://github.com/AtlassianPS/JiraPS/issues/461
I stumbled upon this from search, so figured I'd post this to help others.
Edit: Looks like Jira 8.4 introduced this change, so even if you used Invoke-RestMethod some code change will be required:
https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#creating-an-issue-examples
For anyone arriving here via google:
$pair = "${username}:${password}"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
$base64 = [System.Convert]::ToBase64String($bytes)
$headers = @{ Authorization = "Basic $base64" }
$body = @{
fields = @{
project = @{
key = "ProjectKeyHere"
}
issuetype = @{
name = "Task"
}
summary = "Test Issue via API"
}
}
# Convert the body to JSON format
$body = $body | ConvertTo-Json
Invoke-RestMethod -uri "https://ServerURLHere/rest/api/2/issue" -Method Post -Headers $headers -ContentType "application/json" -Body $body
You can also modify the JiraPS file as shown here:
https://github.com/spicy/JiraPS/commit/fc2632c1f21b3867667197ec2c8e77b266e60e69
Hello @James Underdown
This is the risk you take with using third party libraries.
Switch to using PowerShell's native Invoke-RestMethod. It does mean a bit more coding work on your part, but it always works.
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.
@Rodolfo So I ended up having to use invoke-restmethod, I updated my post above with a code example.
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.