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
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events