Can we import/get data by API, list data in field type "single choice" (Custom field)?
Asked by MQZ-M. Iqbal Rizaldi:

Hi everyone, I have more than 200 data to write down in field type "single choice" (Custom Field) . Is there any workaround to import it or get by API to make it faster? (In picture below there is only 1 button add to list the data)

![SINGLE CHOICE.png](/t5/image/serverpage/image-id/303433i5D40E0CB5C4C2F16/image-size/large?v=v2&px=999 "SINGLE CHOICE.png")


Answers:
author: Luiz Ricardo Pereira da Silva
body: Hello [@MQZ-M. Iqbal Rizaldi](/t5/user/viewprofilepage/user-id/5415067) ,  

You can use the REST API:

<br />

<https://your-domain.atlassian.net/rest/api/3/field/{fieldId}/context/{contextId}/option>

which can be consulted in this article:

<https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option> -post

*   
  However, I can suggest a solution that worked well for me.
* A test project will be required
* Create a project and add a list field to the creation screen;
* Create a CSV file containing the summary field and the list type field (To help, create a model issue, feed the list field with a value and export via CSV);
* Place a generic summary and a different value for the list field in each line of this file;
* Import the CSV file;

This will force a different value created in the list field for each issue it creates in this import.  
I believe it is an easier option, as via API it is complicated to put all the values in a single call.  
In the end, 200 issues will be created in the test project and 200 different options in the list field.

<br />

**Please tell me if this solution helped you!**

<br />

If you need details regarding the process of creating options in a list field via Import CSV, you can answer me here.

comments: author: MQZ-M. Iqbal Rizaldi
body: Oh nice thank you so much, both solution seems good.

But how do I know "fieldID" and "contextID" if I want to try API way


author: Luiz Ricardo Pereira da Silva
body: In the Browser itself, in the Issues - Custom fields option in the global menu.  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/303513i0F1670752FB6FE50/image-size/large?v=v2&px=999 "image.png")  

When accessing the field, your ID will be with you in the URL:  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/303514i10DACCA335C27AAB/image-size/large?v=v2&px=999 "image.png")  

The same happens with Context:  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/303515iE6596000861CA59E/image-size/large?v=v2&px=999 "image.png")  
If you want, you can also use a GET to redeem the IDs  

[https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-get)  

<https://your-domain.atlassian.net/rest/api/3/field/{fieldId}/context/{contextId}/option>


author: MQZ-M. Iqbal Rizaldi
body: Thank you so much, what a knowledge!


Tags: cloud

jira-service-management

jira-service-management-cloud