AtlassianPS / JiraPS

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

Find-JiraFilter #365

Closed vercellone closed 4 years ago

vercellone commented 4 years ago

Description

Adds a Find-JiraFilter function to facilitate finding filters by name (among other things) when the Id is not known. The relevant rest api endpoint is /rest/api/3/filter/search.

Motivation and Context

Get-JiraFilter lacks the ability to retrieve a filter by name, and the performance of its' -Favorite switch is inadequate for large result sets.

Types of changes

Checklist

lipkau commented 4 years ago

Hi @vercellone

Thank you very much for this contribution!

Please allow me a few days to think about this, as it's the first use of an API which is new with version 3 🎉 I don't know yet how to handle the error scenario on a server that does not support v3 yet.

Some question to you, though: Is it a conscious decision not to have any parameter support the pipeline? Or list input for that matter. Also, why not allow for project keys to be passed to the function?

vercellone commented 4 years ago

I did avoid less objective features pending feedback. But, I can implement those.

  1. How should -Sort be handled for Name list and pipeline scenarios considering that some sort properties may not be included in the responses?
vercellone commented 4 years ago

Evidently, the endpoint is unchanged from v2 to v3. 2, 3, and latest all work. So, the currently coded Uri should be fine as-is: $searchURi = "$server/rest/api/latest/filter/search"

lipkau commented 4 years ago

I tested this api on

it's not part of the Jira Server 8 Api doc.

The error return when the API does not exist was

Invoke-JiraMethod : Server responsed with NotFound

this might be relevant to refactor with a "Not supported by server" error once the module has better responses