Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Get-JiraIssueWorklog #402

Closed
asherber opened this issue Feb 5, 2020 · 3 comments · Fixed by #451
Closed

Add Get-JiraIssueWorklog #402

asherber opened this issue Feb 5, 2020 · 3 comments · Fixed by #451

Comments

@asherber
Copy link
Contributor

asherber commented Feb 5, 2020

Context

I'd like to be able to get a full list of issue worklogs. Get-JiraIssue only returns the first 20.

Description

I'd like a function Get-JiraIssueWorklog, modeled after Get-JiraIssueComment that returns a full list of all worklog items for an issue.

Additional Information

Testing locally, I was able to accomplish this by copying the body of Get-JiraIssueComment to a new function Get-JiraIssueWorklog, changing only the URI (comment -> worklog) and the OutputType (JiraComment -> JiraWorklogItem). I also had to add JiraWorklogItem to the ValidateSet for OutputType on Invoke-JiraMethod.

I could submit a PR for this, but I'm not sure I'm able to write the appropriate unit tests.

@nvarscar
Copy link

Just ran into this and I would appreciate this being supported out of the box. And thanks for the workaround idea!

@asherber
Copy link
Contributor Author

@nvarscar Also add Get-JiraIssueWorklog to the FunctionsToExport array in JiraPS.psd1 if you're making mods locally.

@nvarscar
Copy link

I ended up just reusing Invoke-JiraMethod from the source, as I didn't need to interface with the worklog object:

        $parameter = @{
                URI          = "{0}/worklog" -f $issue.RestURL
                Method       = "GET"
                GetParameter = @{
                    maxResults = 1000
                }
                Paging       = $true
                Credential   = $Credential
            }
            $workLogs = Invoke-JiraMethod @parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants