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

0 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
Perisic Nikola
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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 @Perisic Nikola , 

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