Hi,
i am trying to get last updated labels value from script runner using ChangeHistoryItem,
i able to get created time, field name, but can't get from/to values....
objects are null
when i query label collection - it's arranges labels in collection not by adding time, but by name ascending, so stopped on this.
please guide me how to retrieve last added/removed label name
This is quite a hard one to explain, but there is a subtle difference between changing a field value and changing the content of a field value.
Jira stores labels in a list which then becomes the value of the field. The change history records changes to the values of fields, including the to and from. For simple values, this works fine - string "abc" changed to string "cba" or number changed from "42" to "27". The date and time of the change comes from the record that you changed it. Same for lists too - list [a, b, c] changed to list [a, b, c, d] But note that the record is of the change of the list, not a record of what was added or removed from the list.
So, simply put, the data you are trying to find simply isn't there. You've got a record of the change of the list, but not that specific items in it were added or removed.
To establish when a label was added, you will need to
hi, thanks, but issue is that from / to are completely empty. they are not even lists...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
looks like i found way how to get what you were described
i managed to get difference from getChangeHistoryById by changeGroupId
changeHistoryManager.getChangeHistoryById(changeItems.last().changeGroupId).getChangeItems()
now able to see new /old values.
anyway thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.
Learn moreOnline 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.