I am working on a project where we would like to be able to automatically sort the backlog items (and I don't mean filtering them). I have no experience in JQL scripts but I know a scrypt can be utilized to sort the backlog automatically (for example every 24 hours).
What we want to achieve is to sort the items based on priority (in the easiest scenario). If possible, we want to be able to sort things by more complex conditions and levels, i.e. firstly sort them by the release number, then within those releases sort them by epic links and further within those, sort them by their priority.
Anyone can help with that? :D
If the question is on how to code JQL to filter out using different fields you can try something like this:
project = XYZ order by Rank asc, Priority asc, createdDate desc
Questions is not about filtering but creating a scrypt to automatically sort the backlog items (automate a manual process of moving items around).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Atlassian Community!
You would need to build a REST API script that re-ranks your backlog in batches of 50, via https://developer.atlassian.com/cloud/jira/software/rest/api-group-issue/#api-rest-agile-1-0-issue-rank-put
I would very strongly recommend that you never do this. You are destroying the ranking your users have done in their backlogs, rendering the whole backlog functionality utterly pointless, and removing your team's ability to be in the slightest bit agile, because you're micro-managing them (and automating it!).
If you really want to have something that sorts your issues this way and can then be used to inform backlog refinement (not do it, just inform it), then I would
project in (ABC, DEF) and status not in (in-progress, done) and sprint not in sprint in futureSprints() and sprint not in openSprints() order by Priority, release, epic-link
You won't need to code anything, and the filter is dynamic, so you don't need to run it periodically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bother, I forgot.
If you genuinely want to dump the backlog ranking functions, and treat it as though it is a queue, then it's actually quite simple.
Change the board filter from ending with "Order by rank" to "order by priority, release, epic-link".
There's no need to run a sort that way, it'll always be in the right order.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- thank you for that answer. The thing is that this sorting is suppose to help the PO in managing the Product Backlog.
We do not want to turn the ranking system off, as we want to keep the dragging and dropping functionality.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mariusz Bakalarz in the Jira board you could either have sorting by rank and having ability to dragging tickets or via sorting by different fields, but you will lose ability to prioritize things over dragging stuff around.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's something different. I want to introduce a scrypt to the Jira board that will automatically sort the items (like every 24h or by some kind of trigger) by specified conditions. This solution doesn't need changing the sorting by rank option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, this is a direct contradiction:
"... sort the items ... This solution doesn't need changing the sorting by rank option."
The rank is the sort order. If you sort the issues in your backlog, then you're re-ranking them.
If I've misunderstood your requirement here, could you explain more?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Order by ranking allows users to drag and drop items in the backlog. Order by priority denies that action, is that correct?
To reinstate - we want to have a scrypt that will automatically sort the backlog items by given conditions (in order by: epic links -> sprints -> priority), like every 24h or by some sort of trigger and at the same time if the scrypt is not triggered, allow users to move the items around by themselves.
Sorry if that is confusing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The requirement is technically clear, but I think I am confused on why you would want to do it this way.
Let me try to explain what the implications of this are with an example. Imagine you have 8 issues in your backlog today, and you run your sort at 8am, ending up with a backlog that looks like:
Your team arrives for work, does some refinement on the backlog, dragging AA-1 and AA-3 into the next sprint, and notices that AA-5 is dependent on AA-6 being done first, so the backlog becomes:
They continue work on the current sprint.
When they come in tomorrow, your script will have destroyed all their refinement, reverting to the first list.
Are you really saying you want to reset the backlog to your order every day?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
True that is a good observation. Continuing this example, we would like to sort the backlog automatically and get the order you presented:
Then continue with refinement and manual ordering of the items:
And at this point, stop the automated sorting scrypt until it will be needed further in the future. Is it possible to trigger the sorting not daily but for example somehow manually?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be able to run a script whenever you like, but that depends on how you are writing it.
But I'd suggest thinking through when you might want to run it. It's only actually of any use when you have an existing backlog that was not doing any useful form of prioritisation and you've decided to start again because your people have made a hash of it.
Once you've run it and reset the backlog to derived order, then your people will start backlog refinement and never want to use it again. It would be far easier for to say "well, your backlog is a bit of a mess, let's dedicate half an hour to identify what big/urgent items are in the wrong place and fix them", rather than destroying the whole thing and starting from scratch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes that is mostly correct. The thing is I don't know how to create such a script (I have no experience in this field).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You'll need to pick a language you can write a script or program in, one that can make REST calls and work with the responses.
You'll then need to code for something to iterate through your backlog, maybe reading the whole thing, working out an order and then applying it (in batches of 50 because that's what the API is limited to)
Seriously, for something you're only going to run once, that's a lot of work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA Cloud will return items in batches of 100 (see https://jira.atlassian.com/browse/JRACLOUD-67570).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, looks like the docs have not been updated to say 100 instead of the old 50.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure it's possible. But I'm subscribing for this thread. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.