Forums

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

Global context does not exist for the field via API

Ashier de Leon May 20, 2020

I'd like to update a custom combo box field in my JSD via API but I'm getting the error "Global context does not exist for the field 10160". I'm using a next-gen JSD. I tried adding in JIRA custom fields and added the global context, but it seems that "next-gen" JSD projects do not base their custom fields in JIRA as it's not reflecting in my Project.

 

Any ideas on how to go about this?

 

Ashier

1 answer

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 2, 2020

Hi Ashier,

Sorry to hear about this problem.  However next-gen projects handle adding fields quite a bit differently than classic projects do.  By default when you add a custom field to a classic project it tends to default to being a global context field, but you have the option to change contexts for that field.

But next-gen doesn't really give you this global field option.  All the custom fields added to a next-gen project are always set to just the context of that specific project.  There is some more info on why this is different in blogs such as https://blog.developer.atlassian.com/next-gen-projects-jira-cloud/ and https://blog.developer.atlassian.com/developing-for-jira-service-desk-cloud-next-gen-projects/

However, you should still be able to see the info on your field via the REST API, even for a next-gen project.  I tried adding this same type of field to a next-gen JSD project, and strangely enough I found there was an id that also matched 10160 in my response.  But this is not actually the id of the custom field in my instance.  I did a GET to /rest/api/3/field to get back all the fields and then searched in the json for the name of my field (named 'fargo'):

{"id":"customfield_10235","key":"customfield_10235","name":"fargo",
"custom":true,"orderable":true,"navigable":true,"searchable":true,
"clauseNames":["cf[10235]","fargo"],"scope":{"type":"PROJECT","project":{"id":"10160"}},"schema":{"type":"array","items":"option",
"custom":"com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes",
"customId":10235}},

In this case, my customfield id is actually 10235, but I shared that project id value of 10160.  Coincidence?  Possibly, but it might be that this other 10160 id is the project type, or the project id itself. In which case, you might have the wrong id.  That would be one possible explanation for the error message you are getting.

Curious to learn if you can query that same endpoint to see if you might have the wrong field id here.

Let me know.

Andy

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events