Need Java API to update the "available context" for custom fields

Hi Everyone,
I’m working on developing a jira plugin which requires a functionality which will help in updation to “Available Contexts” for a custom field programmatically.

I did check for available REST APIs, but it seems none is available for DC/Server edition. There is an API available for the jira cloud version to update context for custom fields at the below link.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-contexts/#api-rest-api-3-field-fieldid-context-contextid-project-put

Highlighting the required option in the screenshot below for reference.

I m new to Jira plugin development and It will be very helpful if you can let me know the possible ways to modify context for a custom field so that its access is controlled and specified to certain projects only. Need this for Jira Data Center.

Feel free to suggest any other alternatives as well.

Thank You.
Vishal K

Hello @VishalKharde

There is no v2 REST API endpoint for setting the context of custom fields.

That endpoint is only available with the v3 REST API, which is only available for Jira Cloud, not Server or Data Centre.

Refer to JRASERVER-36816