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
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.
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.
Hi Krzysztof,
we are still facing this problem (mismatch contextId ) when calling /rest/api/2/field/{fieldId}/context.
Are you sure this problem has been solved?
This problem occurred in one of our customer.
In the custom field configuration (Forge custom field type module) we have contextId=10388 retrieved from the context object “view.getContext()”,
Elsewhere when calling for the same custom field: rest/api/3/field/customfield_10215/context we received: { "maxResults":50, "startAt":0, "total":1, "isLast":true, "values":[{ "id": "10387", "name": "Default Configuration Scheme for Catagory (ITS)", "description": "Default configuration scheme generated by Jira", "isGlobalContext":true, "isAnyIssueType":true}]}
As you can see, id=10388 does not match 10387.
Additionally, I have a response from rest/api/3/app/field/customfield_10215/context/configuration: {"maxResults":100,"startAt":0,"total":1,"isLast":true,"values":[{"id":"10388","fieldContextId":"10387"}]}
Which id corresponds to the contextId retrieved from view.getContext() in the Forge module?
The context ID retrieved from view.getContext() would match the id property from the response from rest/api/3/app/field/customfield_10215/context/configuration, not fieldContextId. So it seems everything is in order.