Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get customField option, with 403 error

haoyu900914 March 13, 2022

I have a oauth 2.0 app and trying to get the allowedValues for the customFields.

1. I used the `rest/api/3/issue/createmeta` api to get the fields info. some of the fields has allowedValue and some are not. For all customFileds there is no allowedValues info. 

Screen Shot 2022-03-13 at 1.46.33 AM.png

2. Found this api `/rest/api/3/customFieldOption/{id}`. I suppose the  key like `customfield_10020` like the above screenshot should be the id for the customFieldOption. 
I enabled the required scope listed in here https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/
But I still got 403 error. 
The access user is the Jira cloud creator, so I think it has 
 Administer Jira global permission &  Browse projects project permission.

1 answer

0 votes
danielphoenix June 1, 2023

Figured out the issue for my use case. Including it here to help others in the future:

`/rest/api/latest/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}`

^ specify the issue type as whatever your default is, in my case 10001 for story.

From the response, get the values and filter it by fieldID = {your custom field}.

then grab the allowedValues of that field.

$customField = response.values | Where-Object { $_.fieldId -eq "customfield_10020" }

$customFieldOptions = $customField.allowedValues

Suggest an answer

Log in or Sign up to answer