Mismatched filed context id between Get custom field contexts and Get custom field configurations

Our app is Forge app for Jira Cloud.
One of our customer’s Jira site returns mismatched contextId between GET /rest/api/2/field/{fieldId}/context and GET /rest/api/2/app/field/{fieldIdOrKey}/context/configuration.

The rest API request-response details
Request to Get custom field contexts
GET /rest/api/2/field/customfield_12658/context?maxResults=100&startAt=0

Response

        {
            "maxResults": 100,
            "startAt": 0,
            "total": 1,
            "isLast": true,
            "values": [
              {
                "id": "13509",
                "name": "Default Configuration Scheme for Sample Field",
                "description": "Default configuration scheme generated by Jira",
                "isGlobalContext": true,
                "isAnyIssueType": true
              }
            ]
          }

Request to Get custom field configurations
GET /rest/api/2/app/field/customfield_12658/context/configuration

Response

        {
            "maxResults": 100,
            "startAt": 0,
            "total": 1,
            "isLast": true,
            "values": [
              {
                "contextId": 13510
              }
            ]
          }

I think the context ids (13509 and 13510) have to be the same. But, they are not.
I can’t reproduce it on my site. So, I can’t find out the condition to reproduce.
Is it an unexpected behavior? How can it be recovered?

Additional information

  • New custom fields fall into the same state.
  • Nothing changed to field contexts after the field is created.

Please help.

1 Like

This is not expected. After a thorough analysis, we will release a change next week (on Monday if all goes well) that makes things right.

The field and query param contextId in the Issue custom field configuration (apps) operation will be deprecated and replaced with:

  • id , the ID of the configuration entry, which behaves in the same way as the deprecated contextId . Note, this is not the ID of the field context the configuration is associated with, contrary to the previous name.
  • fieldContextId , a reference to the field context ID the configuration is associated with.

The reason for this change is that while contextId was intended to be a reference to a field context ID, in some cases it wasn’t. fieldContextId will serve this purpose now.

The contextId field and query param will be removed on 1 March 2022.

2 Likes

Thank you for your reply.
I understood the coming changes. I will adopt the changes as soon as it’s released.