Open tomcart90 opened 4 years ago
Hi tomcart90,
I performed a simple test using Get-JiraIssueComment as follows:
$cred = Get-Credential 'user'
New-JiraSession -Credential $cred
# 'Key-001' is a placeholder, use a valid story in your system.
Get-JiraIssue 'Key-001' | Get-JiraIssueComment -Verbose
Note $PageSize is currently undefined. The result of the command looks like this
VERBOSE: [Get-JiraIssueComment] Function started
VERBOSE: [Invoke-JiraMethod] Function started
VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable
VERBOSE:
Name Value
---- -----
maxResults
VERBOSE: [Get-JiraSession] Function started
VERBOSE: [Get-JiraSession] Using Session saved in PrivateData
VERBOSE: [Get-JiraSession] Complete
VERBOSE: [Invoke-JiraMethod] Get https://jira.somewhere.com/rest/api/2/issue/9999999/comment?maxResults=
VERBOSE: [Test-ServerResponse] Checking response headers for authentication errors
VERBOSE: [Invoke-JiraMethod] Status code: 200
VERBOSE: [Invoke-JiraMethod] Invoking pagination [currentTotal: 0]
This returned the 5 comments on my sample story.
I then set $PageSize=3
, in order to split up the list into two pages. It looks like it worked correctly for me.
In the first page maxResults=3, and I got 3 comments.
In the second page, maxResults = 3, startAt = 3, and I got an additional two comments as expected.
I would recommend that you try running with the -Verbose parameter specified to see what additional things might be going on for you.
HTH, Scott
We ran into an issue this week due to Get-JiraIssueComment being completely broken for us in versions prior to the following change: https://github.com/AtlassianPS/JiraPS/commit/76f2156627587c4fae371a5f6d3a350bd986ca9d#diff-3d2c0736f2b14e5401333a532d785924. With
Paging
set to$true
the function seems to end up searching jira for comments endlessly. WithPaging
set to$false
the function works as expected.