Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I am using our Jira Cloud instance REST API. I am trying to get a specific history using the "Get Issue" endpoint using the "expand" parameter and the "fields" parameter... I am not getting the results I expected.
Here is the https request:
https://{OUR_INSTANCE}.atlassian.net/rest/api/3/issue/DEP-513/?expand=changelog&?fields=attachment
I am getting the expanded results for this issue, but it is not limited to the 'field' = 'attachment' (I have tried this with the 'status' field as well).
Results:
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_11200.properties,customfield_11201.properties,customfield_11623.properties,customfield_11611.properties,customfield_11610.properties",
"id": "217696",
"self": "https://[OUR_SITE].atlassian.net/rest/api/3/issue/217696",
"key": "DEP-513",
"changelog": {
"startAt": 0,
"maxResults": 32,
"total": 32,
"histories": [
{
"id": "871791",
"author": {
"self": "https://[OUR_SITE].atlassian.net/rest/api/3/user?accountId=5c93d734999a3f2d4cae93fe",
"name": "anirban.roy",
"key": "anirban.roy",
"accountId": "5c93d734999a3f2d4cae93fe",
"avatarUrls": {
"48x48": "https://secure.gravatar.com/avatar/ca666241ff64a3790fbb0fc51483f143?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-0.png&size=48&s=48",
"24x24": "https://secure.gravatar.com/avatar/ca666241ff64a3790fbb0fc51483f143?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-0.png&size=24&s=24",
"16x16": "https://secure.gravatar.com/avatar/ca666241ff64a3790fbb0fc51483f143?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-0.png&size=16&s=16",
"32x32": "https://secure.gravatar.com/avatar/ca666241ff64a3790fbb0fc51483f143?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-0.png&size=32&s=32"
},
"displayName": "anirban.roy",
"active": true,
"timeZone": "America/New_York",
"accountType": "atlassian"
},
"created": "2020-02-11T22:07:21.332-0500",
"items": [
{
"field": "Attachment",
"fieldtype": "jira",
"fieldId": "attachment",
"from": null,
"fromString": null,
"to": "92913",
"toString": "image-20200212-030713.png"
}
]
},
{
... much more original content truncated ...
Dear @brant_brisson ,
you have to use "&expand=changelog" without "fields" parameter to see the history
https://{OUR_INSTANCE}.atlassian.net/rest/api/3/issue/DEP-513?expand=changelog
So long
Thomas
Thomas, thanks for the quick reply. You are saying the I cannot expand the output AND filter it for specific fields at the same time?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what I expect, but feel free to experiment with the upper URL. As it is a GET you can simply copy&paste into browser.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Thomas, I have tried that many times and have not been able to get it to work the way I would expect it to. Will keep trying... this post was to:
1) Try and find someone who had made it work, or,
2) Try to fins someone who can tell me that it will NOT work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @brant_brisson ,
I checked it on my own and you are right. When "fields" is appended as a parameter, the changelog disappears.
I would say, this is the current implementation of the Cloud Rest API. There is nothing wrong. In the REST API doc following is written:
Note: All fields are returned by default. This differs from Search for issues using JQL (GET) and Search for issues using JQL (POST) where the default is all navigable fields.
So no need to add "fields=attachment" , its included.
If you think this is a bug or a limitation, have a look at https://jira.atlassian.com/secure/Dashboard.jspa and feel free tor raise a new suggestion or at lease request for correction of the API Doc.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.