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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,870
Community Members
 
Community Events
184
Community Groups

How to Identify JQL Filters that Reference Name Values

Edited

Scenario

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

 

My Problem

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?

Bonus

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?

2 answers

1 accepted

3 votes
Answer accepted
Kai Sören Becker
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Mar 30, 2023

Hi @Benjamin Dains 

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!

1 vote
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 31, 2023

Using @Kai Sören 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:

  1. I'd first create the SELECT statement to be sure that it only finds those that are needed to be updated.
  2. If it works correctly, then
    1. Stop Confluence
    2. Run the UPDATE statement, one for each issue type name to issue type ID pair.
    3. After each, rerun the SELECT to verify that all occurences disappeared.
    4. Restart Confluence.

Awesome info @Aron Gombas _Midori_ , thank you for that, I'll be looking into it more today. Much appreciated.

Suggest an answer

Log in or Sign up to answer