Hi all,
I'm trying to add a new jira filter by using an insert statement directly on the Jira Mysql database.
Following the commands used:
INSERT INTO jiradb.searchrequest (id, filtername, authorname, username, reqcontent, FAV_COUNT, filtername_lower)
SELECT MAX(id) + 1, 'filter name', 'jirausername', 'jirausername', 'filter request',1,'filter name' FROM jiradb.searchrequest;
INSERT INTO jiradb.sharepermissions (id, entityid, entitytype, sharetype, PARAM1)
SELECT MAX(id) + 1, new id of new filter, 'SearchRequest', 'group', 'group name' FROM jiradb.sharepermissions;
All seems to be done successfully, but I'm not able to find this new filter on my Jira Filter Search page.
May I ask if someone know what's the missing step or the issue here?
Thanks.
Hello,
You should not use Jira database to modify Jira data. Use Jira REST API to create a filter. You can use POST /rest/api/2/filter. You can find more info here:
Thanks for your reply... I've tried through the API and it works well to create a filter.
However there is a limitation, as you cannot change the permissions on the creation request.
So you have to do it manually or later if you can get the id of the new filter.
https://jira.atlassian.com/browse/JRASERVER-45485
Anyway it simplifies my current process.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For your SQL to work, you will need to have Jira off-line while it is run, and you'll need to re-index in full (a locking index) after restarting it. You're also missing stuff in your SQL which will cause you problems later, possibly some loss of data (although it won't be issue data)
Please, stick with the API to do this sort of thing.
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.