Forums

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

CustomField not found using REST API

Dirk February 28, 2024 edited

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 Champion
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
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events