Message7713
When using the rest interface, there is no place to get the history
for the item.
It seems like treating it as a collection endpoint makes sense. So i's
a read-only endpoint accessible via GET.
A url like:
rest/data/issue/23/@history?startdate=20131008022843&enddate=20200102131415&limit=10&sort=-
date&user=rouilj
to get a list of all history for issue23 between 2013-10-08T02:28:43
and 2020-01-02T13:14:15 limited to 10 items sorted by date descending
(most recent first) done by the user rouilj.
Output would look like:
[
{ date: '20131008021438.906', // maybe this should be a number??
user: 'rouilj',
action: 'set',
changes: [
{ field: 'priority', oldval: '1'},
{ field: 'queue', oldval: '3'},
{ field: 'title', oldval: 'my former title'}
]
},
{ more dates/users/actions }
]
Oldval can be null if there was no old value set. But the object
properties in the changes array only works for single value fields
(string, number, link). For multilinks, rather than recording the old
value, we have a change/delta report:
{
...
action: set
changes: [ {field: 'keyword', delta: {add: ['3'], remove: ['8']}} ],
}
because the payload of the change looks like: (('+', ['3']), ('-', ['8'])).
So to get the state of the keyword field before this change, take the current
state and remove 3 and add 8.
Also multilinks support link unlink actions.
{ ... action: 'link', // or unlink
changes: [ {field: 'group', id: '2', class: 'issue'}
}
to indicate that issue 2 was linked into the group field.
Yeah this is complex to generate and consume. We may need a label or
type field to indicate what shape the change data is in.
Technically link/unlink can be seen as a set operation with an 'add'
if something was linked and a 'remove' if something is
unlinked. However representing a link/unlink as a set would differ
from how it's presented in the html interface. Also there may be some
value in knowing how the change was done.
Also there is a create operation which can be represented by:
{ date: '20131008021438.906', // maybe this should be a number??
user: 'rouilj',
action: 'create',
},
I think retire and unretire actions can also be present. |
|
Date |
User |
Action |
Args |
2023-02-12 19:33:32 | rouilj | set | recipients:
+ rouilj |
2023-02-12 19:33:32 | rouilj | set | messageid: <1676230412.46.0.248914215702.issue2551258@roundup.psfhosted.org> |
2023-02-12 19:33:32 | rouilj | link | issue2551258 messages |
2023-02-12 19:33:32 | rouilj | create | |
|