AtlassianPS / JiraPS

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

Update Get-JiraIssueCreateMetadata.ps1 #463

Closed chattes5 closed 1 year ago

chattes5 commented 1 year ago

Title: $resourceURi is updated due to the older API "https://jira./rest/api/2/issue/createmeta?projectKeys=&expand=projects.issuetypes.fields" is inactiv/removed. The new URI is "/rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes"

Description

$resourceURi is updated due to the older API "https://jira./rest/api/2/issue/createmeta?projectKeys=&expand=projects.issuetypes.fields" is inactiv/removed. The new URI is "/rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes"

With JIRA upgraded to 9.1 version, the New-JIRAIssue extension is still making use of the /createmeta api endpoint that leverages parameters passed in via the query string versus as components of the URL call: ie: https://jira./rest/api/2/issue/createmeta?projectKeys=&expand=projects.issuetypes.fields

This request is failing and giving a 404 response. In doing some research, it appears that this model of API call on the server hosted version was deprecated (Jira 8.18.1 (atlassian.com)) and instead expects these calls to be done via the new model:

ie: /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes

Motivation and Context

New-JIRA issue command stopped working which creates new JIRA issue by using the API. Hence automated scripts stopped working. If it fixes an open issue, please link to the issue here as follows: https://bitbucket.org/atlassianlabs/atlascode/issues/753/cannot-open-issue-create-issue-in-vscode

Types of changes

Checklist