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

Invoke-JiraIssueTransition hammers Jira Field API #518

Open
hmmwhatsthisdo opened this issue Aug 14, 2024 · 0 comments
Open

Invoke-JiraIssueTransition hammers Jira Field API #518

hmmwhatsthisdo opened this issue Aug 14, 2024 · 0 comments

Comments

@hmmwhatsthisdo
Copy link
Contributor

Description

Invoke-JiraIssueTransition calls Get-JiraField once per entry in the -Fields parameter, causing unnecessary API traffic and long wait times to transition an issue.

This issue scales linearly (or quadratically in total) with:

  • Count of Jira custom fields (correlates to Get-JiraField response size)
  • Key-count of -Fields parameter

Related to #515.

Steps To Reproduce

  1. Create a Jira instance with a large quantity of custom fields (500+)
  2. Attach JiraPS to the instance
  3. Create an issue, either via JiraPS or the Jira web UI
  4. Transition the issue via Invoke-JiraIssueTransition with some quantity of fields to set in -Fields
  5. Observe long call time

Expected behavior

Invoke-JiraIssueTransition finishes quickly (roughly on-par with web UI)

Screenshots

Your Environment

Get-Module JiraPS -ListAvailable | Select Name, Version
$PSVersionTable

JiraPS 2.14.7

Possible Solution

Based on work in #515, it was determined that simply replacing multiple calls to Get-JiraField with the -Name param with a single, unconstrained call (outside of iteration over -Fields) provided significant performance improvements.

While New-JiraIssue and Set-JiraIssue have the benefit of the CreateMeta and EditMeta endpoints on the Jira API (detailing what fields can and cannot be set), transitions lack a corresponding endpoint. A per-issue transitions API call (/rest/api/2/issue/{key}/transitions) may provide enough highly-contextualized information, but it's unclear if this is comprehensive.

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

No branches or pull requests

1 participant