Hi,
I've done a script that allow me to replace an issue type by an other one in all my Jira.
It works, but it breaks all the filter of the previous type.
Is there a way to change the content of all filter.
Like:
def filterMan = ComponentAccessor.filterManager()
def allFilters = filterMan.getAllFilters()
def jqlRequest
allFilters.each{
if ("issue Type" in it.getJqlRequest()){
jqlRequest = it.jqlRequest()
jqlRequest.replace("issue Type", "new issue Type")
it.setJqlRequest(jqlRequest)
}
}
My main issue consist in getting all the jql request of all the filter.
Regards,
Laurent
Hi,
While doing it with a script seems not possible, database request should do the trick:
Remember to take Jira offline, back up the database, prove you can restore it first, otherwise you could lose the lot.
Never play with SQL without a backup and a clear understanding of what you are doing.
Please, do this with a script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you very much for your warning. I'll do as you say and make sure that i'm able to restore the database before making my modifications.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What do you mean by change the content of a filter? Are you trying to get different results, or update the ones you got from the current filter?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
Actually i want to change the jql request of the filter. To get to your point, i want a different result.
To sum up:
I'm on a french server, and instead of translate types, they created "English types" and "French types". Therefore we have things like type "Bug" and type "Bogue". (Bogue is the french translation for Bug)
I made a script that supress "Bogue" and replace it with "Bug". (i changed all the issue, update issue type screen,...)
It works but i didn't find a way to change filters.
Therefore, if a user had a filter like "project = MP and issuetype = 'Bogue'", it won't work anymore. The result will be empty.
I want to find a way to get through all filters that have "Bogue" in there Jql request and change those jql request by replacing "Bogue" with "Bug". So that my user will have "project = MP and issuetype = 'Bug'"
Any idea ?
Regards,
Laurent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry, this is the hard one to fix. Filters don't (yet) use ids properly, they are plain text, so I'm afraid you have to go fix every one of them manually.
Normally, we're removing the target, so at least they give users an error when they need fixing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
MMmmmm ok, i wanted to remove the target anyway.
Thank you very much for your answer :)
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.