@@ -0,0 +1,1524 @@
+package jira.tool.ea;%0A%0Aimport dbtools.common.utils.ArrayUtils;%0Aimport dbtools.common.utils.StrUtils;%0Aimport jira.tool.db.JiraUtil;%0Aimport jira.tool.db.model.Story;%0A%0Aimport java.util.List;%0A%0Apublic class JiraEpicUtil %7B%0A    private static List%3CStory%3E epicList = null;%0A%0A    public static void updateEpic(String%5B%5D values) %7B%0A        if (ArrayUtils.isEmpty(values)) %7B%0A            return;%0A        %7D%0A%0A        String epicName = values%5BEA2JiraHeaderEnum.EpicName.getIndex()%5D;%0A        if (StrUtils.isEmpty(epicName) %7C%7C StrUtils.isEmpty(epicName.trim())) %7B%0A            return;%0A        %7D%0A%0A        // Query jira db to verify the epic name and get the epic key (link)%0A        synchronized (%22updateEpic.getEpicList%22) %7B%0A            if (epicList == null) %7B%0A                epicList = JiraUtil.getEpicList();%0A            %7D%0A        %7D%0A%0A        if (epicList == null %7C%7C epicList.size() %3C= 0) %7B%0A            return;%0A        %7D%0A%0A        // Compare the epic name and key%0A        epicName = epicName.trim().toLowerCase();%0A        boolean foundEpic = false;%0A        for (Story epic : epicList) %7B%0A            if (epicName.equalsIgnoreCase(epic.getTitle()) %7C%7C epicName.equalsIgnoreCase(epic.getKey())) %7B%0A                values%5BEA2JiraHeaderEnum.EpicName.getIndex()%5D = epic.getTitle();%0A                values%5BEA2JiraHeaderEnum.EpicLink.getIndex()%5D = epic.getKey();%0A                foundEpic = true;%0A                break;%0A            %7D%0A        %7D%0A%0A        if (!foundEpic) %7B%0A            values%5BEA2JiraHeaderEnum.EpicName.getIndex()%5D = null;%0A        %7D%0A    %7D%0A%0A%7D%0A

Read epic from db