Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

https://bitbucket.org/jira-admin-userscripts/jaus/raw/master/src/jaus-reorder-status.user.js

Jira Cloud

Jira DC 7.x

Jira DC 8.x

(tick)

(tick)

(tick)

Use cases

This Userscript was meant for Admins to (less difficultly) manage the Statuses orders to they appear in the right order on Gadgets. If you didn’t know this, Gadgets order Statuses by the global order — Statuses on the top of the list appear on to the left and Statuses on the bottom appear to the right side.

...

After submitting the data by pressing

Status
titleReorder
, the Script will fire the N requests to Jira in the background and wait for 5 seconds. It then reloads the page sequentially. Once the last request finishes, the page’s automatically reloaded and the Status should be in the desired position.

If the status is asked to be moved beyond the top or the bottom of the list (before the 1st or in a position beyond the list length), the requests will be performed anyway but ignored by Jira. No message is returned to the Admin as this doesn’t impact the Userscript’s usage.

Note

After some 5 seconds after you pressed

Status
titlereorder
, the page will reload automatically. Your Browser may prompt you if you want to reload the page and you must select “yes” - or else the page will keep showing the status as it was before the Userscript’s executionVersion 1.0 would reload the page after 5 seconds and it might not’ve been enough for all positions to be shifted — also a browser reload prompt would show up.

Version 1.1 fires the requests sequentially so it knows when the last finishes and only then reloads the page. It also clears the form so no browser reload prompt is triggered.

Mechanics

JAUS Reorder Status is a request automation script that performs many parallel sequential HTTP requests to Jira at once, as if the Admin had performed them through the browser - only very quickly and simultaneously (it’s a request to a web page, not a REST API endpoint).

In general terms, the Userscript:

  1. Tries to find the Jira create button on top (when in the ViewStatuses page). If it finds it, it injects the JAUS Context Button.

  2. When the JAUS button’s pressed, it injects a light box on top of the screen that can be closed anytime.

  3. The Admin is requested to inform the Status Id, the direction (up or down) and the number of positions (“N”) the Status should be moved.

  4. If the Admin presses the Reorder button in the light box, JAUS fires N requests like the example below to Jira, waits 5 seconds and reloads the page .after the last one’s returned:

Code Block
<BASE-JIRA-URL>/secure/admin/StatusUp.jspa?up=<Status Id>
or
<BASE-JIRA-URL>/secure/admin/StatusDown.jspa?down=<Status Id>

...

Please select the Component jaus-reorder-status.

Roadmap

...

JAUS Reorder Status may be improved to make the light box more pleasant to the eyes. It may also be improved to better handle the background requests and delay to the page reload (maybe not even requiring the User’s confirmation).

& known issues

If you’d like to open a bug or suggest an improvement or new feature to JAUS Reorder Status, please do so through the JAUS Help Portal, selecting the component jaus-reorder-status:

Known issues

Please submit them through JAUS Help Portal!status.

Jira Legacy
serverSystem JIRA
columnskey,summary,type,status,fixversions
maximumIssues10
jqlQuerycomponent in (jaus-core, jaus-reorder-status) and resolution = Unresolved order by status desc
serverId063a25af-750d-3ebb-aad9-699eb90d2107

Jira feature request

Please vote, watch and comment on these feature requests!

...