Custom Field Manager returning wrong list of custom fields(created using project specific select field plugin) which doesn't have specified project id set in the field context

Issue #92 invalid
Vishal Kharde created an issue

Hi Holger,

Good day.
We have developed a custom build Jira plugin. In AUI select dropdown field we are fetching custom fields based on their project context by using following method:

private final CustomFieldManager cfm = ComponentAccessor.getCustomFieldManager();

private List<CustomField> projectSpecificCustomFields(Long projectId, List<String> issueTypes) {return cfm.getCustomFieldObjects(projectId, issueTypes);}

In my local Jira software with Jira version 8.17.1, custom fields are getting fetched as expected and I am able correctly extract custom fields in which project is present in custom field context.

But in our Jira Test Instance(Data Center version 8.19.0), Custom fields of type Project Specific Select field ( i.e custom fields created using Project Specific Select field plugin) are appearing in the dropdown list even though those fields are not present in custom field context.[i.e cfm.getCustomFieldObjects(projectId, issueTypes); is giving me the Project Specific Select fields which are not having the specified projectId in the field context ]

Can you please help me understand why custom fields created using Project Specific select field plugin is not getting filtered in our Jira test instance? Is there any compatibility issue? Can you please suggest if there is any alternative to fetch the project specific select fields based on ProjectID or Project Key instead of the rest api which u have already provided(get a list of all Project Specific Custom fields available for a certrain project GET http://localhost:2990/jira/rest/projectspecificselectfield/1.0/customfield/FCTA)

Comments (3)

  1. Holger Schimanski repo owner

    Hello Vishal,

    I am not fully sure how CustomFieldManager actually works, but could it be, that for that Project Specific Field a global context exist and that is the reason why it is listed?

    And also please be aware, that there are different custom field types provided by Project Specific Select Field addon.

    • Project Specific Select Field and Project Specific Multi Select Field which are based on single and multi select field
    • Project Specific Select Field (simple) which is based on text field, hence does not have a context for management of the option values.

    Best regards
    Holger

  2. Holger Schimanski repo owner

    Closing this ticket because of no further communication. Guess all is sorted out.

    Best regards, Holger

  3. Log in to comment