How to select all issues that in project1 and custom_field = "value" directly from database?I need it in order to get issues without checking permissions. JQL example: project = proj1 and custom_field1 = value
You can probably find this information in SQL with a query like this:
select cfv.issue, cfv.stringvalue, cf.cfname, P.PKey || '-' || issue.IssueNum as IssueKeyfrom CustomFieldValue cfv join CustomField CF on CF.Id = CFV.CustomFieldjoin jiraissue issue on issue.id = cfv.issuejoin Project P on issue.Project = P.Idwhere P.pkey='SCRUM' and cf.cfname='text1';
This works in postgresql, but the syntax might be different for other database types. In my case my project key here is called 'SCRUM' and my custom field name is 'text1' (both without quotes.
This is a horrible way to get data from Jira, please consider doing it properly instead.
But, if you must, then you will need to join Project (or hard-code the specific project), customfield (or hard-code it again) and customfieldvalue with Jiraissue to find it. It will also be inaccurate if config has been changed in certain ways, and it will ignore any permissions and security.
can you provide an example of query pls?
It will be quicker for you to work it out for myself. I would never do it this way, so I've got nothing to hand.
@Olexandr Polinkevych what does this mean "without checking permissions"? You want to get a specific data despite in JIRA you do not have access because of permissions to them?
Yes, i do.
Thank you a lot, that's exactly what i need!
It looks like you're new here. Sign in or register to get started.