It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Reordering Jira Statuses

Ever noticed how Statuses often aren't in the order you expect them to be in Dashboards or filter results?

That happens because Dashboards (and JQL's order by) order Statuses by their global order. That order is the same for all projects.

 

With admin credential, access .../secure/admin/ViewStatuses.jspa and you'll see the Statuses global order, from top (first) to bottom (last).

Having over a hundred Statuses (don't ask me :-)) and realizing their global order is all messed up can be upsetting. And new Statuses are put last in order by default.

 

You can proceed to reorder each status by clicking in the up/down arrows one-by-one or fallback to one of the lazy webdeveloper's favorite tool: JMeter! :-)

 

1) Open .../secure/admin/ViewStatuses.jspa and mouseover the "edit" link on the status you wish to reorder.

The URL will reveal the status ID, ex. .../secure/admin/EditStatus!default.jspa?id=12800

 

2) Decide how many positions you want to move up or down. Precision might not be critical here. Usually just keeping most of "todo" above "in progress" and above "done" is a good start.

 

3) Copy and paste the XML in the bottom into a new file and save it with ".jmx" extension. Comments are in pt_BR but nevermind. It was tested in JMeter 2 and 5.

 

4) Open JMeter and open the newly created file. Edit the settings like the prints below:

status_method: StatusUp or StatusDown (mopve up or down in the global order)
status_id: The ID you got in step 1).
loop_count: The number of positions you want to move the status up or down.
Hostnaem or IP: ex. jira.yourcompany.com
os_username: An Admin's username
os_password: The admin's password

jira-status-01.pngjira-status-02.pngjira-status-03.png


5) Just save it and play it! It's very fast. On the first executions set the loop_count to few values just to test the config.

 

6) Open .../secure/admin/ViewStatuses.jspa and confirm the Status has been reordered accordingly! :-)

You might need to tweak some more configs depending on your Jira or proxy setup...

 

Happy housekeeping!

 

XML:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.0 r1840935">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Ordem de status no Jira" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="Variáveis Definidas Pelo Usuário" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Controlador de Iteração" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1441750292000</longProp>
<longProp name="ThreadGroup.end_time">1441750292000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="VARIAVEIS" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="status_method" elementType="Argument">
<stringProp name="Argument.name">status_method</stringProp>
<stringProp name="Argument.value">StatusUp</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.desc">StatusUp ou StatusDown</stringProp>
</elementProp>
<elementProp name="status_id" elementType="Argument">
<stringProp name="Argument.name">status_id</stringProp>
<stringProp name="Argument.value">XYZ</stringProp> <!-- REPLACE WITH STATUS ID -->
<stringProp name="Argument.desc">ID do status</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="loop_count" elementType="Argument">
<stringProp name="Argument.name">loop_count</stringProp>
<stringProp name="Argument.value">10</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.desc">Número de vezes pra subir ou descer o status</stringProp>
</elementProp>
</collectionProp>
</Arguments>
<hashTree/>
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="Cookie" enabled="true">
<collectionProp name="CookieManager.cookies"/>
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
</CookieManager>
<hashTree/>
<AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="Auth" enabled="true">
<collectionProp name="AuthManager.auth_list"/>
</AuthManager>
<hashTree/>
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">XYZ</stringProp> <!-- REPLACE WITH JIRA'S URL -->
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
<stringProp name="HTTPSampler.concurrentPool">4</stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout">60000</stringProp>
<stringProp name="HTTPSampler.response_timeout">60000</stringProp>
</ConfigTestElement>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="Variáveis Definidas Pelo Usuário" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="os_username" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">XYZ</stringProp> <!-- REPLACE WITH ADMIN USERNAME -->
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">os_username</stringProp>
</elementProp>
<elementProp name="os_password" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">XYZ</stringProp> <!-- REPLACE WITH ADMIN PASSWORD -->
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">os_password</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/rest/gadget/1.0/login</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">true</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="TestPlan.comments">Faz login com um usuário admin no Jira</stringProp>
</HTTPSamplerProxy>
<hashTree/>
<LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Repetição" enabled="true">
<boolProp name="LoopController.continue_forever">true</boolProp>
<stringProp name="LoopController.loops">${loop_count}</stringProp>
<stringProp name="TestPlan.comments">Repete a chamada da URL &quot;loop_count&quot; vezes</stringProp>
</LoopController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Movimentação de status" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="Variáveis Definidas Pelo Usuário" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="up" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">${status_id}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">up</stringProp>
</elementProp>
<elementProp name="down" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">${status_id}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">down</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/secure/admin/${status_method}.jspa</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">true</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="TestPlan.comments">Chama a URL parametrizada pra mover a ordem de um Status pra cima ou pra baixo</stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
</hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>

 

7 comments

Hi,

I had to change the request to work with websudo:websudo_jmeter.PNG

Cheers
Christian

Like Rodrigo likes this

This is a severe failing on Atlassian's part. Reordering statuses should be straight forward.

I agree @Chanda Pwapwa  - It should just be a drag and drop...Soo Complicated.

I can't make this work for Cloud - I'm guessing the single-signon process breaks the script trying to log in?

I can't believe that I just downloaded and installed Apache JMeter just to reorder my statues ...

Hey boss, can we hire an intern, just for a day or two?

 

Sure, why?

 

So I can get them to reorder my Jira statuses...

Rodrigo Community Leader May 09, 2019

Hi @Martin Gregory 

The script I pasted works on Server and might need some adjustments for Cloud, yeah. I guess mostly on signup, though.

JMeter renders the returned page even in error cases. What message was rendered in your attempt?

It was an authorisation failed type message.

Comment

Log in or Sign up to comment
Community showcase
Published in Agile

Why can't I manage my Sprint while I am the SCRUM Master?

As a SCRUM Master, one of your key tasks involves planning Sprints in your team and in order to do this, you must be able to create new Sprints and complete active ones. In order to fulfil these ta...

303 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you