JiraPS icon indicating copy to clipboard operation
JiraPS copied to clipboard

Fix Depricated Search Endpoint

Open GamerClassN7 opened this issue 4 months ago • 9 comments

Description

Fix almost unusable function Get-JiraIssue After last jira api updtate Issue: https://github.com/AtlassianPS/JiraPS/issues/535

Motivation and Context

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • [X] My code follows the code style of this project.
  • [X] I have added Pester Tests that describe what my changes should do. (Not necessary)
  • [X] I have updated the documentation accordingly. (Not necessary)

GamerClassN7 avatar Sep 05 '25 07:09 GamerClassN7

@GamerClassN7 This definitely needs fixing but is this the right fix?

The error in https://github.com/AtlassianPS/JiraPS/issues/535 talks about migrating to the v3 endpoint, so I'd be expecting to see this change from v2 to v3

https://github.com/AtlassianPS/JiraPS/blob/339b93e8239c51780bf9ad864cbdf885b67f701c/JiraPS/Public/Get-JiraIssue.ps1#L99

harryjohn-dev avatar Sep 05 '25 14:09 harryjohn-dev

@GamerClassN7 This definitely needs fixing but is this the right fix?

The error in #535 talks about migrating to the v3 endpoint, so I'd be expecting to see this change from v2 to v3

https://github.com/AtlassianPS/JiraPS/blob/339b93e8239c51780bf9ad864cbdf885b67f701c/JiraPS/Public/Get-JiraIssue.ps1#L99

Yes it is i was not able to make it work under api v3 with my fix it seems to work correctly even pagination etc.

GamerClassN7 avatar Sep 09 '25 12:09 GamerClassN7

@GamerClassN7 This definitely needs fixing but is this the right fix? The error in #535 talks about migrating to the v3 endpoint, so I'd be expecting to see this change from v2 to v3 https://github.com/AtlassianPS/JiraPS/blob/339b93e8239c51780bf9ad864cbdf885b67f701c/JiraPS/Public/Get-JiraIssue.ps1#L99

Yes it is i was not able to make it work under api v3 with my fix it seems to work correctly even pagination etc.

Pagination need some work it is not as reliable a observed first time

GamerClassN7 avatar Sep 09 '25 13:09 GamerClassN7

@harryjohn-dev made some changes acording to documentation

GamerClassN7 avatar Sep 09 '25 13:09 GamerClassN7

Thank you for your contribution! 🙌

The pagination logic was already not trivial in the past, but have 2 definitely makes it more complicated. My first instinct is to refactor so that we extract them into dedicated private functions.

This would also make it easier to test.

lipkau avatar Sep 09 '25 14:09 lipkau

Thank you for your contribution! 🙌

The pagination logic was already not trivial in the past, but have 2 definitely makes it more complicated. My first instinct is to refactor so that we extract them into dedicated private functions.

This would also make it easier to test.

I am afraid i am not so silled in souch Architecture, i wass happy i can help with problem, and found the solution but i am araid that i no able to fufill your request without help :/ Feel free to message me on discord :) i am in your server now :)

GamerClassN7 avatar Sep 09 '25 14:09 GamerClassN7

Problem is that this function affect many companies worl wide so maybe as common groud would be possible to make some beta release and get them working and then do the refactoring as you sugested ? :)

GamerClassN7 avatar Sep 09 '25 14:09 GamerClassN7

Probably related Add-JiraIssueWorklog no loger is able to inser worklog item. image

Invoke-JiraMethod: Obsah pracovnĂ­ho protokolu nenĂ­ platnĂ˝.
Invoke-JiraMethod: Zápis práce nesmí být null.
Invoke-JiraMethod:  worklog ------- INVALID_INPUT
$issue | Add-JiraIssueWorklog -Comment '{ "version": 1, "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "Hello " }, { "type": "text", "text": "world", "marks": [ { "type": "strong" } ] } ] } ] }' -TimeSpent $spendTime -DateStarted $startTime

coments need to be submited in nev format there should be -comment and -commentRaw for this purpose

GamerClassN7 avatar Sep 16 '25 17:09 GamerClassN7

Also there is soem changes to comment system in general comment in worklogs now return @{type=doc; version=1; content=System.Object[]} instead of comments.

GamerClassN7 avatar Sep 17 '25 10:09 GamerClassN7