CustomField not found using REST API

Dirk February 28, 2024

Good day 

I keep getting in my response 'The custom field was not found'

Not sure what I am missing?

And yes I did check and made sure the custom field is in Jira and that the ID matches 

`/secure/admin/EditCustomField!default.jspa?id=CUSTOMFIELDID`

 

const res = await axios.get(`${jiraBaseUrl}/field/${customFieldId}/context`, {

headers: {

Authorization: `Basic ${auth}`,

Accept: "application/json",

},

});

 
I do have a request that fetches my ticket, and that works 100%, it is just this endpoint giving me issues for some reason

2 answers

1 accepted

3 votes
Answer accepted
Dirk February 28, 2024

Solved the issue, the CustomFieldId should be `customfield_ID` and not just the id, which is subtracted from `customfield_ID`, wish the documentation could be clear on that :) 

 


const response = await api.asUser().requestJira(route`/rest/api/3/field/{fieldId}/context`,
{
headers
: { 'Accept': 'application/json' }
});

 

0 votes
Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 28, 2024

Welcome to the community @Dirk !

Have you tried using this endpoint: /rest/api/3/field/{fieldId}/context?

Dirk February 28, 2024

Hi @Nikola Perisic , 

Jip that is the endpoint I am using, the `jiraBaseUrl` is just a variable I am using 

Suggest an answer

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

Atlassian Community Events