Created
August 7, 2015 15:40
-
-
Save azakordonets/737e6e99c1d0dec87563 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected boolean fieldWasChanged(String fieldName, IssueEvent issueEvent, String fieldValue) throws GenericEntityException { | |
| boolean result = false; | |
| List<GenericValue> changeItemList = issueEvent.getChangeLog().getRelated("ChildChangeItem"); | |
| Iterator<GenericValue> changeItemListIterator = changeItemList.iterator(); | |
| while (changeItemListIterator.hasNext()) { | |
| GenericValue changeItem = (GenericValue) changeItemListIterator.next(); | |
| String currentFieldName = changeItem.get("field").toString(); | |
| if (currentFieldName.equals(fieldName)) // Name of custom field. | |
| { | |
| Object oldValue = changeItem.get("oldstring"); | |
| Object newValue = changeItem.get("newstring"); | |
| if (oldValue!= null && newValue != null){ | |
| if (!oldValue.equals(newValue) && newValue.equals(fieldValue)) result = true; | |
| break; | |
| }else if (oldValue == null && newValue != null) { | |
| if (newValue.equals(fieldValue)) result = true; | |
| break; | |
| } | |
| } | |
| } | |
| return result; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment