Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can Jira select a random sample of issues for QA?

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

Hi all,

I'm looking to implement some sort of random processing within Jira. Only 25% of a specific sub-task needs to go through QA, so does anyone know of a way to do one of the following:

  • Out of a list of jql-filtered issues, give a random 25% of these the value of 'Needs QA' (in a custom field), OR
  • Having a side-step status in a workflow of 'QA Pending', that only a random 25% of the filtered issues will transition through, and the other 75% of sub-tasks will bypass this status

Any ideas would be much appreciated!

1 answer

1 accepted

1 vote
Answer accepted
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

@Callum Carlile _Automation Consultants_ ,

You can use Automation for Jira (which is standard in Cloud). You should be able to make a rule that selects a random number and multiply that with the number of issues within your query.

See the Random function here.

So you could make a custom field that sets a field (checkbox) in 25% of the time during a certain transition/creation of a subtask.

If you need help, just say the word, I'll try to figure something out if I have time.

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

Thanks @Rudy Holtkamp , this sounds exactly what I'm looking for! I'll have a play around with this and let you know if I have any questions.

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

Here is the rule, at least the logic to get the 25%

 

image.png

{{#=}}ROUND(RANDOM()*4,0){{/}}

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

 

@Rudy Holtkamp I'm not entirely sure where I would enter this smart value, where I'd select the 0.25 (25%) value and what field to edit, would this all be done within a rule action?

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

What you do is,

1. Select a trigger (green block in the picture above): e.g. issue transition to a certain status

2. create a condition (yellow block in the picture above) and choose advanced compare condition. I used the smart values to get randomly a number between 1 and 4. And if the value is greater than 3

3. Then you can add an edit issue (blue block) and set the 'select this item for QA'-field (or whatever you've called it).

Afterwards you can easily use JQL to get all issues where that field is set.

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

@Rudy Holtkamp Thank you very much for this information.

By default, most of the issues need to go through QA (so the "QA Required?" field will have a default value of Yes). However for some of the isssues (e.g. of a particular issue type) they do not need to be QA'd, so the value can be set to No. Do you think that the following rule therefore work for this?

(where the 'less than 4' refers to the 75% of issues which do not need to go through QA, and the action is setting the "QA Required?" field to No)

example rule.PNG

Like Rudy Holtkamp likes this
Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

Also with the {{#=}}ROUND(RANDOM()*4,0{{/}} condition, will 0 ever be added as a value? If so, there would be 5 numbers, would this need to be changed to {{#=}}ROUND(RANDOM()*4,1{{/}} to make it 75% and not 80%?

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

Yes, my logic is flaw.

Better to use  {{#=}}CEILING(RANDOM()*4){{/}}.

Now everything between 0..1 wil be 1, between 1..2 will be 2, etc.

Like # people like this
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2020

I think, with the above improved logic, your rule will work.

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 1, 2020

All seems to be working fine! Thank you very much for your help @Rudy Holtkamp !

ed_corke August 9, 2021

Hi there. Automation beginner here.  I'm attempting to do exactly this- in my case, with a 10% sample. I want it to add a new label to the selected issues, so I can then filter these issues onto a new board for review. Is there any reason this rule below isn't working?  Apologies if I've misunderstood something here, I'm pretty much just copy and pasting the above with altered thresholds. I've also set this to manually trigger- am I assuming right that if I manually trigger this from a single issue, the rule will still run across the entire issue base, not just on that one single issue? Thanks!automation.png

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 6, 2021

Hi @ed_corke ,

Sorry to be late to your party... I missed it due to vacation.

First of all if you use the random function in two different actions, you will end up having two different random numbers. Which means the number you are logging is not the number you are comparing to. If you want to have only one random number, you should use the 'Create variable' action. Call it {{random number}} and use that to log an compare. Which might already solve your problem.

Furthermore I can't see what could be wrong.

Might be the edit labels part, but there are no details shown.

Mario July 28, 2022

Hi @Rudy Holtkamp I'm having the same issue.

I want to generate a random sample of tickets based on a JQL. The sample is 5% of the tickets captured.

Tried to run the rule with either Ceiling or Round and the issue itself is that since the numbers are being thrown at random. The numbers themselves repeat before all avail numbers are used

Meaning, you can have the number '4' listed three times before the list of numbers available is finished. Meaning that even tho the selection is being made at random the sample taken is not equivalent to a 5%

See below:

Screen Shot 2022-07-28 at 13.33.24.pngScreen Shot 2022-07-28 at 13.34.33.png
Do you have any suggestions on how to make the rule finish the numbers available selection before repeating numbers again?

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2022

Hi @Mario ,

Interesting problem again. 

So what you want is 5% of your selected issues to be marked with a certain label. That is not quite possible. But what you can do is to label an issue with a 5% chance, which should be more or less the same if your selection is large enough. E.g. if you have 20 issues in your selection, the chance to not exactly select 5% is higher than when you have 2000 issues in your selection. 

What you need to do is the following:

  1. Remove the JQL in the trigger
  2. Add the Lookup Issues action and add the JQL
  3. Add an advanced branching
  4. Add a condition {{#=}}CEILING(RANDOM()*{{lookupIssues.size}}){{/}} is greater than {{#=}}{{lookupIssues.size}}*0.95{{/}}
  5. Add comment
  6. Add label

This should 'select' an issue in 5% of the cases.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events