In one of our projects people worked with two labels that have different upper/losecase letters, but are equal otherwise (e.g. myLabel_1 , mylabel_1).
Now the trouble is that (for whatever reason) some people even added both labels to their issues.
I tried using
labels = myLabel_1 AND labels = mylabel_1
and Jira (Server) even suggests both labels as different ones. But when the search runs, it does not take the "AND".
From what I found, Jira accepts camelcase as a label and in the auto-completion of the JQL, but neglects camelcase when searching.
Has anyone faced this and found a solution that can be done from the UI or REST API? Or can give me a hint? I am not very fond of messing around directly in the database.
Thank you for the answers.
I adapted the answer of @Bert van Dijk _TMC_nl_ to the following, that I had already summarized in the comment to Bert.
This worked ok, even though the handling of Labels in Jira (Server/DC at least) seems inconsistent to me.
you should be able to export all your issues to CSV, and then write a script to detect the duplicate labels. Then, you might be able to use the bulk edit flow to clean up the data.
Alternatively, if you're open to solutions from the Atlassian Marketplace, I think you should get pretty close using the app that my team and I are working on, JXL for Jira.
JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of advanced features, including support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting - as well as the ability to filter issues via regular expressions.
With regular-expression-based filtering, you can apply pretty much any logic, including the one that you are after:
(Note how the issues have labels pied-piper and Pied-Piper.)
The regex that I'm using is
(^|, )(?<label>[\w-]+)(, [\w-]+)*, \k<label>($|,)
There's a few things going on here, but TLDR, it checks if a certain label, captured as <label>, reoccurs somewhere in the field (via \k<label>).
You can also check for specific labels; say you want to check for multiple occurrences of myLabel_1, mylabel_1, etc., you could use
(^|, )mylabel_1(, [\w-]+)*, mylabel_1($|,)
(In both cases, just make sure that the Match case option is off.)
Once you've identified your issues, you can work on them directly in JXL (e.g., bulk edit them via copy/paste), or trigger various operations in Jira.
Since you've tagged your question for Jira Server: As you may have heard, apps sales have ended for Jira Server. Are you planning to migrate to Data Center or Cloud? I'd strongly recommend that. If you need some more time, JXL is perfectly compatible with Jira Server; it's just that we need to generate a license for you. If the above looks interesting, just let me know, and I'll happily start a free trial for you.
Hope this helps,
Best,
Hannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Hannes Obweger - JXL for Jira , thanks for pointing the app out. But I wanted to do this one without using a new app.
To your other question: we are currently migrating Confluence and will afterwards migrate Jira to the Cloud as well.
As for the license: thank you for your offer, but we are fine. Looking at the Jira migration I seriously wish I had far less Apps installed in that instance :D.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Benjamin Horst ,
This is a good reason for not using labels, but use an option field. This can be a custom field or for example the component field. You can use the "bulk edit" feature to migrate all values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am completly with you. I regularly recommend to no use labels in Jira at all, because using them is errorprone in comparison to your mentioned alternatives.
As for the bulk edit : I don't see how I can copy values from one field to the other in a bulk edit. So it would have to be:
The users still want to use labels, so they could continue with that.
Did you mean something like this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As for the bulk edit : I don't see how I can copy values from one field to the other in a bulk edit.
Just to put this out there, this would also be trivial to do using JXL for Jira; you can easily copy/paste any number of values from one column to another, and many of our customers use JXL exactly for data clean up activities like yours. You can also bulk copy/paste between JXL and e.g. Excel or Google Sheets, if this makes things easier:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.