Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

What's the correct ID to use for /rest/api/3/customFieldOption/<field_id>?

Edited

I'm attempting to a list of all allowed values for a custom-single select field using the v3 API and frankly, it's making me lose my ever-loving mind.

1. Fetch ID of custom field

```

/rest/api/latest/field

```

 

2. Inspect response for ID

```json

{
"id": "customfield_10252",
"key": "customfield_10252",
"name": "Employer Partner",
"untranslatedName": "Employer Partner",
"custom": true,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"cf[10252]",
"Employer Partner",
"Employer Partner[Dropdown]"
],
"schema": {
"type": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"customId": 10252
}
},

```

 

3. Pass ID (`10252`) to `customFieldOption` end-point

```

/rest/api/3/customFieldOption/10252

```

 

4. Get back different (wrong) field

```json

{
"self": "/rest/api/3/customFieldOption/10252",
"value": "BAU (ongoing support, maintaining operations)"
}

```

 

BAU isn't even one of the dropdown/single-select options. Obviously, I'm doing something wrong, any pointers?

_FYI I'm aware I can use the editmeta end-point (`/rest/api/3/issue/GR-1/editmeta`) but that requires a known ticket ID and it brings back a much larger payload._

1 answer

1 accepted

0 votes
Answer accepted

Of course the second I post I find out my issue. I was using the wrong end-point for select lists, use this instead:

```

/rest/api/3/field/customfield_10252/context/10487/option

```

1. field ID is the full name (with customfield_)

2. Screen context ID I pulled from the "Edit Context" URL

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events