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

API deselect option from custom field single-select not working

Felipe Ribeiro August 27, 2021

Hello, I'm trying to deselect an option from a custom single-select field and it's not working: 

DEL 

/rest/api/3/field/${fieldKey}/option/${optionId}/issue
returns me a async response, the response: 

"id": "10524",
"description": "Remove option 2 from issues matched by '*', and replace with option null",
"status": "COMPLETE",
"result": {"modifiedIssues": [10053,10051]},

After this I try to delete this option via:

DEL 
/rest/api/3/field/${fieldKey}/option/${optionId}

and the response: 

{"errorMessages":["This option cannot be deleted as it is set in the following issues (this list is limited to 10, there might be more): [10051, 10053]"]

It was working normally before yesterday, any help would be appreciated

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2021

Hi Felipe,

I understand that you have a connect app that is calling the endpoint of DELETE /rest/api/3/field/{fieldKey}/option/{optionId}/issue and shortly after that appears to complete, trying to then delete the option using DELETE /rest/api/3/field/{fieldKey}/option/{optionId} is failing.

Given that the first call is providing a status complete message appears to rule out my first suspicion that this async call was simply taking a long time to complete.

I'd be interested to see if you can lookup those individual issues in Jira to see what values they report having for that field.  I'm thinking use the endpoint of GET /rest/api/3/issue/{issueIdOrKey} in between the first call and the second call.  If those issues actually do have some replaced value stored to them here.  If they do that would at least explain the error here. 

Curious to learn more about the results here, or if trying to run that 2nd call again succeeds now.

Andy

leonardo_nunes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 15, 2021

Hi @Andy Heinzer 

I have the same problem Felipe reported. I did the steps you asked and the endpoint DELETE /rest/api/3/field/{fieldKey}/option/{optionId}/issue is really not having any effect. I'll show below the steps I tried.

 

1. Called /rest/api/3/issue/SKP1-7 to make sure this issue have the custom field with a selected option.

Screen Shot 2021-09-15 at 16.22.50.png

2. Called /rest/api/3/field/{fieldKey}/option/3/issue to deselect all issues with option 3 selected. As you can see below the response was already with status COMPLETE and progress 100. The modifiedIssues list show the ID of my issue correctly.

Screen Shot 2021-09-15 at 16.22.24.png

3. Called /rest/api/3/issue/SKP1-7 again, but customfield_10038 still have option 3 selected.

Screen Shot 2021-09-15 at 16.22.50.png

 

I even tried with api v2 but didn't work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events