We received a requirement to change the name of Bug to Defect in Jira, but I've identified that many of the JQL filters created in our Jira instance reference that issuetypes name, and not the id.
After a little testing, I figured out we can just use that issuetypes id and it works in place of the name. See example below.
// This will give you a list of bugs, but if the name is changed to defect for example, this JQL will break.
issuetype = "Bug"
// But if you change the JQL to this, it will be resilient to name changes.
issuetype = 10004
It's great we have a solution to this and we can update to the issuetype id before we migrate the changes, but is there a way to find out which filters have components that reference the name property instead of the id property so I don't have to go through JQL filters one by one?
Is there a way to not only find the list of filters using this convention, but also a way to update those filters programmatically using something like ScriptRunner or Jira Automation?
easiest way would be to check the database. Thats how we usually handle these filters.
The corresponding table would be "searchrequest"
SELECT * FROM searchrequest WHERE reqcontent LIKE '%issuetype = Bug%' OR reqcontent LIKE '%type = Bug%';
Thank you so much for that info! That will really help to save me some time. I appreciate you taking the time to comment and help out!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using @Kai Becker 's suggestion to solve the "bonus" you defined, you could craft an SQL UPDATE statement which replaces "issuetype = Bug" with "issuestpye = 123" directly in the database using string replace, so that the other parts of the JQL remains untouched.
Notes:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome info @Aron Gombas _Midori_ , thank you for that, I'll be looking into it more today. Much appreciated.
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.