Hi,
I'm quite new using the Jira Rest API. I'm trying to improve our CI/CD processes integrating as many things(Jira activities) as possible in our pipeline.
I didn't have big problem with the GET method to retrive the information but on the other hand, I 'm encountering a lot of problems if I want to create something on Jira through a -Rest API using Powershell scripts.
Using this kind of script to add a new version in the Jira Releases section:
$accessToken = “token_copied_from_Jira_user_Configuration”
$headers = @{Authorization = “Bearer $accessToken”}
$JsonBody = '{
"name": "Tp_Logger_v.X.X.X.XXX",
"archived": false,
"released": false,
"projectId": 11701
}'
$r = Invoke-RestMethod -Headers $headers -Uri 'https://my.jira.server/rest/api/2/project/MYPROJECT_NAME/version/' -Method 'POST' -ContentType 'application/json' -Body $JsonBody
this is the answer:
Invoke-RestMethod : The remote server returned an error: (405) Method Not Allowed.
Also using the Postman software I obtained this:
The strange thing is also that from the postman headers, I can see, in the last row, that the allowed methods are Head, Get and Options!
We have this version: Jira v8.20.11
THX
BR
Antonio
Hi,
at the end, after some experiment I found the error...it was related to the URI i used to generate a new version!
Uri = "https://my.jira.server/rest/api/2/version/"
Using this, the creation is performed correctly!
;-)
BR
Antonio
Hi @Antonio Giusto
I am trying the same using below url still getting 405. Can you please help me out?
https://pranavl.atlassian.net/rest/api/2/issue/KAN-2
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.