Old and New Value from Cascading Select

Topher March 3, 2015

I have a listener on issue update and I need to get the old and new values of all the fields that were modified. I have this set up by doing the following:

List changeItems = event.getChangeLog().getRelated("ChildChangeItem")

I then iterate through the changeItems and get the information I need using oldstring and newstring. The problem is with the Cascading Select field type of which we have a few. Instead of giving just the string of the value like the other issue types it instead gives a string in the form "Parent values: FirstValue(xxxxx)Level 1 values: SecondValue(xxxxx)" where FirstValue and SecondValue are the actual selected options. Is there anyway to get the old and new cascading select options without all the extra information?

1 answer

1 accepted

0 votes
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2015

Is oldvalue and newvalue any better? The old and new "string" are the display values and not that useful.

However this is something that JIRA is not particularly good at, you always lose type information for the historical values. If all else fails you may need to parse it with a regex.

Topher March 3, 2015

I only get null for oldvalue and newvalue for the Cascading Selects. I was hoping maybe there was some kind of method I overlooked and I wanted to stay away from parsing, but it looks like that might be my only option for this type of field.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2015

Like I said, this is an area of weakness in jira. If you can use a post-function then you can get better info.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events