What's the difference between "id" and "key" for fields?


#1

If I make a REST API call against “https://acmecorp.atlassian.net/rest/api/2/field” it returns me the list of the system and custom fields. Each entry has an “id” and a “key” property, but I cannot see any case where the two are different.

Can someone tell me their meaning? (The REST API docs aren’t very talkative regarding this.)


#2

Hi, @aron.gombas,

Keys are currently used only if you have a Connect app that adds issue fields. Then the issue field ID will be a standard automatically generated “customfield_N”, but its key will be equal to your module’s key, the same across all instances, making it easier for your app to work with such a field.

In all other cases IDs are equal to keys (for Jira system fields, and built-in custom fields).

We are in the process of updating our documentation so in the future this should be more clear.

Best regards,
Krzysztof


#3

Thanks, Krzysztof.
(I’ve tried this with Tempo managed fields and they work like you described.)