AtlassianPS / JiraPS

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

Jira 9 breaks creating Jira issues #461

Open gforke97 opened 1 year ago

gforke97 commented 1 year ago

Description

Get-JiraIssueCreateMetadata fails in Jira Version 9.0 according to a short research its because the used API is deprecreated

Steps To Reproduce

Run Get-JiraIssueCreateMetadata against a Jira Server with Version 9.0 or higher

Expected behavior

Get the Meta Data needed to create an Issue

Your Environment

Jira 9.0

Get-Module JiraPS -ListAvailable | Select Name, Version

Name Version


JiraPS 2.14.6

$PSVersionTable

Name Value


PSVersion 7.2.5 PSEdition Core GitCommitId 7.2.5 OS Microsoft Windows 10.0.22000 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

Possible Solution

https://bitbucket.org/atlassianlabs/atlascode/issues/753/cannot-open-issue-create-issue-in-vscode

gforke97 commented 1 year ago

Jira Server not cloud btw

rjl61 commented 1 year ago

Same for 9.1. I also discovered that the API call used by Get-JiraIssueCreateMetadata was not only deprecated but missing entirely. I was already making some local changes to use the new API call when I saw your post. The workaround does work after also making changes to the ConvertTo-JiraCreateMetaField for the different structure.

saeid-adz commented 1 year ago

I have the same problem! @rjl61 would you please share what changes have you made to solve the problem? It's pretty urgent for me! Thanks!

jcrivas1971 commented 1 year ago

Is there any chance that we will see a solution for this issue? @rjl61: Could you please provide your solution? Thanks.

spicy commented 1 year ago

@jcrivas1971 @saeid-adz This is my solution. I have not significantly tested this but it seems to work for my purposes. https://github.com/spicy/JiraPS/commit/fc2632c1f21b3867667197ec2c8e77b266e60e69

saeid-adz commented 1 year ago

@spicy Thanks mate! Worked for me too! I have several types of connection and automation based on this module and I can confirm that the issues have been solved by using your solution! Thanks again!

jcrivas1971 commented 1 year ago

@saeid-adz: I am sorry but I guess you have to thank @spicy. @spicy: I will try the solution next week. Thanks in advance for your work.

saeid-adz commented 1 year ago

@jcrivas1971 Thanks mate, I selected the wrong userId! edited now :)

jcrivas1971 commented 1 year ago

@spicy: It took a while but I was able to test your fix today. It works perfectly!! Thanks a lot.

mwoffenden commented 1 year ago

@spicy I need to integrate this fix today into my local WindowsPowerShell\Modules\JiraPS\2.14.6\JiraPS.psm1, what's the right way to do this? Or can we somehow get a fixed module?

spicy commented 1 year ago

@spicy I need to integrate this fix today into my local WindowsPowerShell\Modules\JiraPS\2.14.6\JiraPS.psm1, what's the right way to do this? Or can we somehow get a fixed module?

I don't think this project is being supported since my merge request was not accepted yet. You can just copy my code and modify the function if it's visible. Otherwise you can put the new function in a new ps1 to call instead. Hope this helps

mwoffenden commented 1 year ago

You can just copy my code and modify the function if it's visible. Otherwise you can put the new function in a new ps1 to call instead.

@spicy Thanks - I did try that locally, made the edits to "function Get-JiraIssueCreateMetadata" but the error still shows up, so I must be doing something wrong. We (along with many others) very much need this fixed.

Any idea how to build an updated module using your fixed code?

mwoffenden commented 1 year ago

Can anyone help with this?

jcrivas1971 commented 1 year ago

@mwoffenden: spicy forked the original project and provided a fixed version. Instead of a local edit you should probably try to use his version or just the corrected file? You could download the whole project as a zip file and either copy the whole directory or just the above mentioned file. Just go to spicy/JIRAPS. I hope this helps.

mwoffenden commented 1 year ago

@jcrivas1971 Yes, we finally did download the code and made the edits locally, this solution seems to be working for us. However I can imagine that the ideal is to have the master JiraPS brought up to date so that people downloading from the Powerhsell gallery can have a working version.

eXpl0it3r commented 1 year ago

So what's the status with proper Jira 9 support, @lipkau?

claudiospizzi commented 7 months ago

Same issue here. What I can see, this is related to this change: https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html

We've created a workaround for our use case, and we use this internally. Not sure if this covers all cases and if it is a complete workaround. Anyway, if someone finds that helpful: https://github.com/arcadech/JiraPS/commit/5d2805357475c4564ef013d4a36e497d23f68595

ChefkeGremmen commented 3 months ago

@claudiospizzi ; thank you so much for this. I hope the maintainers find room to get the CICD pipeline up and running again so your pull-request can get processed. Your change fixed our situation.