I am using below code for getting custom fields available for a project and issue type.
ComponentAccessor.getCustomFieldManager().getCustomFieldObjects(project.getId(), issueType)
The problem is, when I configure my custom field's visibility for a particular project and issue type, I don't get the correct result. But when I configure my custom field for a project only, then I get the correct result. So, there is something wrong when I assign an issue type to it.
Is there any known issue, that custom fields are not correctly returned when they are assigned to issue types?