How to easily distinguish "Start Date" fields from other custom fields?

Using the rest API, I’m trying to find a way to easily distinguish the “Start Date” fields in Jira Cloud and in Jira Data Center from all other fields.

On Jira Server, there is a “Target Start” field and this is the API response for that field.

{
        "id": "customfield_10109",
        "name": "Target start",
        "custom": true,
        ...
        "schema": {
            "type": "date",
            "custom": "com.atlassian.jpo:jpo-custom-field-baseline-start",
            "customId": 10109
        }
    },

Looks like the custom is unique, so I should be able to always find this field for any instance. Just wanted to confirm that my assumption is correct for Jira Server?

For Jira Cloud, the custom seems generic so I don’t think I can use that to distinguish from other date fields. However, I’ve noticed that the key is the same across two different instances that I have access to. Is that a coincidence? Or is the key for “Start Date” in Jira Cloud guaranteed to be “customfield_10015” across all instances?

{
        "id": "customfield_10015",
        "key": "customfield_10015",
        "name": "Start date",
        "untranslatedName": "Start date",
        "custom": true,
        ...
        "schema": {
            "type": "date",
            "custom": "com.atlassian.jira.plugin.system.customfieldtypes:datepicker",
            "customId": 10015
        }
    },
1 Like

Hi @HassanRachid. Short answer: coincidence. If you do create two vanilla (freshly made) Jira Cloud instances, I think it would be safe to say that you’ll find the custom field IDs to be the same; however, I can answer with absolute certainty that you cannot bet that Start date’s customId always be 10015 across all instances. The same can be said about other custom fields as well.

Looks like the custom is unique

custom at the top level is boolean that indicates whether it is a standard system field (val false) or a field added by an admin (val true). And custom at the schema level isn’t unique either. The only thing that would be unique is id, key, and schema.customId.

That being said, I’m not sure how helpful that was toward solving your problem. Is it that you have too many custom fields that are labeled as “Start Date” spread across a bunch of different projects that were created over the years?

1 Like

Do other fields have "com.atlassian.jpo:jpo-custom-field-baseline-start" for their schema custom?

I figured that the keys for Jira Cloud were a coincidence, but wanted to make sure. The concern is that an admin can name any field “Start date” so I was hoping there was a way to get the exact field I wanted just like I could with a standard field such as “Due Date” - just need to find the field with the key “duedate”

Looking for a date field with the untranslated name “Start Date” or “Target Start” may be enough, though. Thanks!