I wanted to fetch an issue and the no of times the "Bug Fix Date" (custom field) has been updated and what is the new and old value mentioned in Bug Fix date field. Could you please help me if you tried it out ?
I tried to use the REST API calls getChangeItemsWithFieldsForIssues, but am not sure how to call this REST service. Could you please help me on this ?
Thanks,
Lavanya
Hi Lavanya,
I understand that you are using Jira Cloud and want to find all the times that a custom field changed values for a particular issue via the REST API. This is something that our documentation on Get issue GET /rest/api/3/issue/{issueIdOrKey} can help with here.
In this case, I believe you will want this request to use both the expand=changelog and the fields=Bug Fix date in order to return just the events that changed that field on this issue. For example, I made this same request via curl and it looked like this:
curl -D- -X GET -H "Authorization: Basic [redacted]" -H "Content-Type: application/json" "https://[redacted].atlassian.net/rest/api/3/issue/SCRUM-53?expand=changelog&fields=select-A"
In my case, my custom field is called 'select-A', and my issuekey was SCRUM-53. In turn I got back the results of:
{"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations","id":"10172","self":"https://[redacted].atlassian.net/rest/api/3/issue/10172","key":"SCRUM-53","changelog":{"startAt":0,"maxResults":2,"total":2,"histories":[{"id":"10992","author":{"self":"https://[redacted].atlassian.net/rest/api/3/user?accountId=[redacted]","accountId":"[redacted]","emailAddress":"myuser@example.com","avatarUrls":{"48x48":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=48&s=48","24x24":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=24&s=24","16x16":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=16&s=16","32x32":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=32&s=32"},"displayName":"Andy Heinzer","active":true,"timeZone":"America/Chicago","accountType":"atlassian"},"created":"2020-03-10T17:21:55.609-0500","items":[{"field":"select-A","fieldtype":"custom","fieldId":"customfield_10097","from":"10132","fromString":"1","to":"10134","toString":"3"}]},{"id":"10991","author":{"self":"https://[redacted].atlassian.net/rest/api/3/user?accountId=[redacted]","accountId":"[redacted]","emailAddress":"myuser@example.com","avatarUrls":{"48x48":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=48&s=48","24x24":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=24&s=24","16x16":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=16&s=16","32x32":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/[redacted]/128?size=32&s=32"},"displayName":"Andy Heinzer","active":true,"timeZone":"America/Chicago","accountType":"atlassian"},"created":"2020-03-10T16:04:41.084-0500","items":[{"field":"select-A","fieldtype":"custom","fieldId":"customfield_10097","from":null,"fromString":null,"to":"10132","toString":"1"}]}]}}
I only changed the value of that field on that issue twice so far. You can also line this up by the issue history tab such as in:
I hope this helps to explain how you could use these parameters on this endpoint to get back this data via the REST API. If you have any questions about this, please let me know.
Regards,
Andy
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.