Using Postman to add all projects in Jira as options in a select list field via the REST API, and automatically updating the custom field whenever a new project is added.
Hi @İclal Aslan ,
Welcome to the Atlassian Community!
As per my knowledge, solution is not straight forward. Please consider below steps to achive this.
Step1: Retrieve the list of all projects from a Jira Cloud instance using the REST API, you can use the /rest/api/2/project/search endpoint. This endpoint returns a paginated list of projects, and you'll need to handle pagination if you need to retrieve all projects.
/rest/api/2/project/search
Step2: Having Custom field ID and Context ID, using below REST End point you can update the custom field options with values received from Step1.
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-put
Please let me know if you still have any questions.
Regards
RK
Hi @İclal Aslan
You can use such rest api endpoint: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-put.
And you need to create a rule, which will add a new option with this endpoint every time when a new project is added.
Or you can just use the Project Picker field type for your purposes.
It looks like you're new here. Sign in or register to get started.