When search using the new search endpoint, we found that the "versionedRepresentations" expand field returns NULL.
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
When trying to perform a search using the following endpoint, we noticed that the "versionedRepresentations" expand field is returning NULL in the new endpoint.
New endpoint:
/rest/api/3/search/jql
However the legacy endpoint which deprecated is returning the value for "versionedRepresentations"
Legacy endpoint:
/rest/api/3/search:
versionedRepresentations → Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the fields parameter is ignored
New REST API Link: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-jql-get
Old REST API Link: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get
NEW REST API: https://XXXX.atlassian.net/rest/api/3/search/jql?jql=key=XX-XX&expand=versionedRepresentations
Output
{
"issues": [
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "XXX",
"self": "https://XXXXX.atlassian.net/rest/api/3/issue/XXX",
"key": "XXX-XXX",
"versionedRepresentations": {
}
}
]
}
Old REST API: https://XXXXX.atlassian.net/rest/api/3/search?jql=key=XX-XXX&expand=versionedRepresentations
Output
{
"expand": "names,schema",
"startAt": 0,
"maxResults": 50,
"total": 1,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "XXXXXX",
"self": "https://XXXX.atlassian.net/rest/api/3/issue/XXXXX",
"key": "XXX-XXXX",
"versionedRepresentations": {
"customfield_XXX": {
"1": null
},
"customfield_XXX": {
"1": null
},
"customfield_XXX": {
"1": null
},
}
}
環境
Jira Cloud
原因
The new REST API does not hydrate any fields by default and only returns the ID, so there is nothing to expand. In contrast, the old APIs provided many fields by default, which users did not need as previous APIs used to offer all fields by default.
ソリューション
We need to use fields parameter to tell Jira which fields you want to expand in the Versioned Representations or you can simply use "fields=*all" in order to get all the fields.
fields=statuscategorychangedate or fields=*all
https://XXXXX.atlassian.net/rest/api/3/search/jql?jql=key=XX-XX&fields=statuscategorychangedate&expand=versionedRepresentations
Output
{
"issues": [
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "xxx",
"self": "https://xxxxx.atlassian.net/rest/api/3/issue/xxxx",
"key": "xx-xXXX",
"versionedRepresentations": {
"statuscategorychangedate": {
"1": "2025-01-27T13:06:33.944+0530"
}
}
}
]
}