REST: retrieve a list of CF with their names


#1

Hi guys,

I work on an application which integrates with RT. At one place I want to show user a list of available custom fields which it can fill in.

The issue is that I only found a way to retrieve a list of CF ids:
/REST/2.0/customfields?page=2&per_page=100
{
“count”: 100,
“page”: 2,
“per_page”: 100,
“total”: 5571,
“items”: [
{
“id”: “1449”,
“type”: “customfield”,
“_url”: “/REST/2.0/customfield/1449”
},
{
“id”: “326”,
“type”: “customfield”,
“_url”: “/REST/2.0/customfield/326”
},

But users don’t know ids and I want to show them names and probably descriptions.

I can get details for a certain CF, but I can’t do it for all 6000 CFs
/REST/2.0/customfield/326
{
“_hyperlinks”: [
{
“ref”: “self”,
“id”: “326”,
“type”: “customfield”,
“_url”: “/REST/2.0/customfield/326”
}
],
“Pattern”: “”,
“Type”: “Select”,
“Disabled”: “0”,
“UniqueValues”: “0”,
“id”: “326”,
“LastUpdated”: “2019-03-09T03:57:05Z”,
“Creator”: {
“id”: “someone”,
“type”: “user”,
“_url”: “/REST/2.0/user/someone”
},
“LastUpdatedBy”: {
“id”: “RT_System”,
“type”: “user”,
“_url”: “/REST/2.0/user/RT_System”
},
“LookupType”: “RT::Queue-RT::Ticket”,
“MaxValues”: “1”,
“SortOrder”: “0”,
“Created”: “2006-05-16T14:04:43Z”,
“EntryHint”: “Select one value”,
“Description”: “CustomField for applications-workplace queue”,
“Name”: “Accepted as”
}

I’m thinking about running the second query for all CF once per week and keeping data in a database, but maybe I’m missing something and there is a way to get what I need with REST call to RT?

Thanks