SELECT
concat ( '<CWD_USER>', STRING_AGG ( RESULT.data_xml, '' ), '</CWD_USER>' ),
1 AS FILTER
FROM
(
SELECT
concat ( '<row>', '<id>', ID, '</id>', '<user_name>', user_name, '</user_name>', '<email_address>', email_address, '</email_address>', '</row>' ) data_xml
FROM
PUBLIC.cwd_user
) AS RESULT UNION
SELECT
concat ( '<ISSUETYPE>', STRING_AGG ( RESULT.data_xml, '' ), '</ISSUETYPE>' ),
2 AS FILTER
FROM
( SELECT concat ( '<row>', '<id>', ID, '</id>', '<pname>', pname, '</pname>', '</row>' ) data_xml FROM PUBLIC.issuetype ) AS RESULT UNION
SELECT
concat ( '<PROJECT_KEY>', STRING_AGG ( RESULT.data_xml, '' ), '</PROJECT_KEY>' ),
3 AS FILTER
FROM
( SELECT concat ( '<row>', '<project_id>', project_id, '</project_id>', '<project_key>', project_key, '</project_key>', '</row>' ) data_xml FROM PUBLIC.project_key ) AS RESULT UNION
SELECT
concat ( '<JIRAISSUE>', STRING_AGG ( RESULT.data_xml, '' ), '</JIRAISSUE>' ),
4 AS FILTER
FROM
(
SELECT
concat ( '<row>', '<id>', ID, '</id>', '<issuenum>', issuenum, '</issuenum>', '<project>', project, '</project>', '</row>' ) data_xml
FROM
PUBLIC.jiraissue
) AS RESULT UNION
SELECT
concat ( '<ISSUESTATUS>', STRING_AGG ( RESULT.data_xml, '' ), '</ISSUESTATUS>' ),
5 AS FILTER
FROM
( SELECT concat ( '<row>', '<id>', ID, '</id>', '<pname>', pname, '</pname>', '</row>' ) data_xml FROM PUBLIC.issuestatus ) AS RESULT UNION
SELECT
concat ( '<CUSTOMFIELD>', STRING_AGG ( RESULT.data_xml, '' ), '</CUSTOMFIELD>' ),
6 AS FILTER
FROM
(
SELECT
CONCAT ( '<row>', '<id>', ID, '</id>', '<cfname>', "cfname", '</cfname>', '</row>' ) data_xml
FROM
PUBLIC.customfield
WHERE
customfieldtypekey = 'com.atlassian.jira.plugin.system.customfieldtypes:userpicker'
OR customfieldtypekey = 'com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker'
OR customfieldtypekey = 'com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker'
OR customfieldtypekey = 'com.atlassian.jira.plugin.system.customfieldtypes:grouppicker'
) AS RESULT UNION
SELECT
concat ( '<WORKFLOWS>', STRING_AGG ( RESULT.data_xml, '' ), '</WORKFLOWS>' ),
7 AS FILTER
FROM
(
SELECT
CONCAT ( '<action ', removeText.RESULT, '</action>' ) AS data_xml
FROM
(
SELECT SUBSTRING
( actionFilter."action" FROM 0 FOR ( POSITION ( '>' IN actionFilter."action" ) + 1 ) ) AS RESULT
FROM
( SELECT UNNEST ( string_to_array( DESCRIPTOR, ' <action ' ) ) AS ACTION FROM jiraworkflows ) AS actionFilter
) AS removeText
WHERE
POSITION ( 'name' IN removeText.RESULT ) > 0
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL>' ),
8 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<ASSIGNEE_ENABLED>',
"ASSIGNEE_ENABLED",
'</ASSIGNEE_ENABLED>',
'<CONDITIONAL_RULE_ID>',
"CONDITIONAL_RULE_ID",
'</CONDITIONAL_RULE_ID>',
'<CONFIG_ID>',
"CONFIG_ID",
'</CONFIG_ID>',
'<DESCRIPTION>',
"DESCRIPTION",
'</DESCRIPTION>',
'<GROUPS>',
"GROUPS",
'</GROUPS>',
'<GROUP_PICKER>',
"GROUP_PICKER",
'</GROUP_PICKER>',
'<ID>',
"ID",
'</ID>',
'<NAME>',
"NAME",
'</NAME>',
'<NOT_ASSIGNEE>',
"NOT_ASSIGNEE",
'</NOT_ASSIGNEE>',
'<NOT_GROUPS>',
"NOT_GROUPS",
'</NOT_GROUPS>',
'<NOT_GROUP_PICKER>',
"NOT_GROUP_PICKER",
'</NOT_GROUP_PICKER>',
'<NOT_LEAD>',
"NOT_LEAD",
'</NOT_LEAD>',
'<NOT_REPORTER>',
"NOT_REPORTER",
'</NOT_REPORTER>',
'<NOT_ROLES>',
"NOT_ROLES",
'</NOT_ROLES>',
'<NOT_USERS>',
"NOT_USERS",
'</NOT_USERS>',
'<NOT_USER_PICKER>',
"NOT_USER_PICKER",
'</NOT_USER_PICKER>',
'<NOT_USER_PICKER_ANY>',
"NOT_USER_PICKER_ANY",
'</NOT_USER_PICKER_ANY>',
'<OPERATOR>',
"OPERATOR",
'</OPERATOR>',
'<PROJECT_LEAD_ENABLED>',
"PROJECT_LEAD_ENABLED",
'</PROJECT_LEAD_ENABLED>',
'<REPORTER_ENABLED>',
"REPORTER_ENABLED",
'</REPORTER_ENABLED>',
'<ROLES>',
"ROLES",
'</ROLES>',
'<SA>',
"SA",
'</SA>',
'<SHOW_TYPE>',
"SHOW_TYPE",
'</SHOW_TYPE>',
'<USERS>',
REPLACE ( "USERS", '&', '&' ),
'</USERS>',
'<USER_PICKER>',
"USER_PICKER",
'</USER_PICKER>',
'<USER_PICKER_ALL_EXPR>',
"USER_PICKER_ALL_EXPR",
'</USER_PICKER_ALL_EXPR>',
'<USER_PICKER_ANY>',
"USER_PICKER_ANY",
'</USER_PICKER_ANY>',
'<USER_PICKER_ANY_EXPR>',
"USER_PICKER_ANY_EXPR",
'</USER_PICKER_ANY_EXPR>',
'<EXPR_IN_DETAIL>',
"EXPR_IN_DETAIL",
'</EXPR_IN_DETAIL>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_CONFIG_PROPERTIES>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_CONFIG_PROPERTIES>' ),
9 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<DESCRIPTION>',
"DESCRIPTION",
'</DESCRIPTION>',
'<ID>',
"ID",
'</ID>',
'<PROPERTY>',
"PROPERTY",
'</PROPERTY>',
'<VALUE>',
"VALUE",
'</VALUE>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_CONFIG_PROPERTIES"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_CONFIG>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_CONFIG>' ),
10 AS FILTER
FROM
(
SELECT
CONCAT (
CONCAT (
'<row>',
'<ABSTAIN_ACTION_ENABLED>',
"ABSTAIN_ACTION_ENABLED",
'</ABSTAIN_ACTION_ENABLED>',
'<APPROVAL_TAG>',
"APPROVAL_TAG",
'</APPROVAL_TAG>',
'<APP_COND_WF_UPDATABLE>',
"APP_COND_WF_UPDATABLE",
'</APP_COND_WF_UPDATABLE>',
'<APP_PANEL_FILTER>',
"APP_PANEL_FILTER",
'</APP_PANEL_FILTER>',
'<AUTO_GRANT_PERM>',
"AUTO_GRANT_PERM",
'</AUTO_GRANT_PERM>',
'<AWT_CMRA>',
"AWT_CMRA",
'</AWT_CMRA>',
'<CHECK_INFO>',
"CHECK_INFO",
'</CHECK_INFO>',
'<CUSTOM_DEFINE_APPROVAL>',
"CUSTOM_DEFINE_APPROVAL",
'</CUSTOM_DEFINE_APPROVAL>',
'<CUSTOM_REQUESTER_APPROVAL>',
"CUSTOM_REQUESTER_APPROVAL",
'</CUSTOM_REQUESTER_APPROVAL>',
'<DELEGATION_ENABLED>',
"DELEGATION_ENABLED",
'</DELEGATION_ENABLED>',
'<ENABLED_NAC>',
"ENABLED_NAC",
'</ENABLED_NAC>',
'<EXPANED_APP_PANEL>',
"EXPANED_APP_PANEL",
'</EXPANED_APP_PANEL>',
'<FROM_EMAIL>',
"FROM_EMAIL",
'</FROM_EMAIL>',
'<HIDE_HACTION_ABSTAINED>',
"HIDE_HACTION_ABSTAINED",
'</HIDE_HACTION_ABSTAINED>',
'<HIDE_HACTION_APPROVED>',
"HIDE_HACTION_APPROVED",
'</HIDE_HACTION_APPROVED>',
'<HIDE_HACTION_APP_NOTIFY>',
"HIDE_HACTION_APP_NOTIFY",
'</HIDE_HACTION_APP_NOTIFY>',
'<HIDE_HACTION_AUNOTIFY>',
"HIDE_HACTION_AUNOTIFY",
'</HIDE_HACTION_AUNOTIFY>',
'<HIDE_HACTION_AUTRANS>',
"HIDE_HACTION_AUTRANS",
'</HIDE_HACTION_AUTRANS>',
'<HIDE_HACTION_COMMENT>',
"HIDE_HACTION_COMMENT",
'</HIDE_HACTION_COMMENT>',
'<HIDE_HACTION_NPENDING>',
"HIDE_HACTION_NPENDING",
'</HIDE_HACTION_NPENDING>',
'<HIDE_HACTION_PENDING>',
"HIDE_HACTION_PENDING",
'</HIDE_HACTION_PENDING>',
'<HIDE_HACTION_REJECTED>',
"HIDE_HACTION_REJECTED",
'</HIDE_HACTION_REJECTED>',
'<HIDE_HACTION_REPLY_NOTIFY>',
"HIDE_HACTION_REPLY_NOTIFY",
'</HIDE_HACTION_REPLY_NOTIFY>',
'<HIDE_HACTION_SING_NOTIFY>',
"HIDE_HACTION_SING_NOTIFY",
'</HIDE_HACTION_SING_NOTIFY>',
'<HIDE_HISTORY_ACTION>',
"HIDE_HISTORY_ACTION",
'</HIDE_HISTORY_ACTION>',
'<HIDE_HISTORY_APPROVAL>',
"HIDE_HISTORY_APPROVAL",
'</HIDE_HISTORY_APPROVAL>',
'<HIDE_HISTORY_APPROVER_C>',
"HIDE_HISTORY_APPROVER_C",
'</HIDE_HISTORY_APPROVER_C>',
'<HIDE_HISTORY_DESTINATION_S>',
"HIDE_HISTORY_DESTINATION_S",
'</HIDE_HISTORY_DESTINATION_S>',
'<HIDE_HISTORY_SOURCE_S>',
"HIDE_HISTORY_SOURCE_S",
'</HIDE_HISTORY_SOURCE_S>',
'<HIDE_HISTORY_TRANS>',
"HIDE_HISTORY_TRANS",
'</HIDE_HISTORY_TRANS>',
'<HIDE_MENU>',
"HIDE_MENU",
'</HIDE_MENU>'
),
CONCAT (
'<HIDE_PACOMMENT>',
"HIDE_PACOMMENT",
'</HIDE_PACOMMENT>',
'<HIDE_PACTION>',
"HIDE_PACTION",
'</HIDE_PACTION>',
'<HIDE_PAPP_NAME>',
"HIDE_PAPP_NAME",
'</HIDE_PAPP_NAME>',
'<HIDE_PDETAIL>',
"HIDE_PDETAIL",
'</HIDE_PDETAIL>',
'<HIDE_PREQUEST_NOTIF>',
"HIDE_PREQUEST_NOTIF",
'</HIDE_PREQUEST_NOTIF>',
'<HISTORY_COLUMN_TITLES>',
"HISTORY_COLUMN_TITLES",
'</HISTORY_COLUMN_TITLES>',
'<HISTORY_EXPAND_ROWS>',
"HISTORY_EXPAND_ROWS",
'</HISTORY_EXPAND_ROWS>',
'<HISTORY_FILTER>',
"HISTORY_FILTER",
'</HISTORY_FILTER>',
'<HISTORY_GROUP_BY>',
"HISTORY_GROUP_BY",
'</HISTORY_GROUP_BY>',
'<ID>',
"ID",
'</ID>',
'<LABEL_ABSTAIN_BUTTON>',
"LABEL_ABSTAIN_BUTTON",
'</LABEL_ABSTAIN_BUTTON>',
'<LABEL_ACTION_APPROVAL>',
"LABEL_ACTION_APPROVAL",
'</LABEL_ACTION_APPROVAL>',
'<LABEL_APPROVAL_BUTTON>',
"LABEL_APPROVAL_BUTTON",
'</LABEL_APPROVAL_BUTTON>',
'<LABEL_APPROVAL_NAME>',
"LABEL_APPROVAL_NAME",
'</LABEL_APPROVAL_NAME>',
'<LABEL_APP_COMMENT>',
"LABEL_APP_COMMENT",
'</LABEL_APP_COMMENT>',
'<LABEL_DETAIL>',
"LABEL_DETAIL",
'</LABEL_DETAIL>',
'<LABEL_HISTORY_ACTION>',
"LABEL_HISTORY_ACTION",
'</LABEL_HISTORY_ACTION>',
'<LABEL_HISTORY_APPROVAL>',
"LABEL_HISTORY_APPROVAL",
'</LABEL_HISTORY_APPROVAL>',
'<LABEL_HISTORY_APPROVER_C>',
"LABEL_HISTORY_APPROVER_C",
'</LABEL_HISTORY_APPROVER_C>',
'<LABEL_HISTORY_DESTINATION_S>',
"LABEL_HISTORY_DESTINATION_S",
'</LABEL_HISTORY_DESTINATION_S>',
'<LABEL_HISTORY_SOURCE_S>',
"LABEL_HISTORY_SOURCE_S",
'</LABEL_HISTORY_SOURCE_S>',
'<LABEL_HISTORY_TRANS>',
"LABEL_HISTORY_TRANS",
'</LABEL_HISTORY_TRANS>',
'<LABEL_REJECT_BUTTON>',
"LABEL_REJECT_BUTTON",
'</LABEL_REJECT_BUTTON>',
'<LABEL_REQUEST_APPROVAL>',
"LABEL_REQUEST_APPROVAL",
'</LABEL_REQUEST_APPROVAL>',
'<LABEL_REQUEST_APPROVALS>',
"LABEL_REQUEST_APPROVALS",
'</LABEL_REQUEST_APPROVALS>',
'<LABEL_REQUEST_NOTIFY>',
"LABEL_REQUEST_NOTIFY",
'</LABEL_REQUEST_NOTIFY>',
'<LABEL_RESET_BUTTON>',
"LABEL_RESET_BUTTON",
'</LABEL_RESET_BUTTON>',
'<LARGE_BUTTONS>',
"LARGE_BUTTONS",
'</LARGE_BUTTONS>',
'<LOCK_ACTION_ENABLED>',
"LOCK_ACTION_ENABLED",
'</LOCK_ACTION_ENABLED>',
'<NOTIFICATION_RECIPIENT_CUSTOM>',
"NOTIFICATION_RECIPIENT_CUSTOM",
'</NOTIFICATION_RECIPIENT_CUSTOM>',
'<RESPONSIVE_AWT>',
"RESPONSIVE_AWT",
'</RESPONSIVE_AWT>',
'<TAB_COMM_DISABLED>',
"TAB_COMM_DISABLED",
'</TAB_COMM_DISABLED>'
),
CONCAT (
'<TAB_HISTORY_ENABLED>',
"TAB_HISTORY_ENABLED",
'</TAB_HISTORY_ENABLED>',
'<USER_APPROVER_BULK>',
"USER_APPROVER_BULK",
'</USER_APPROVER_BULK>',
'<USER_AWT>',
"USER_AWT",
'</USER_AWT>',
'<USER_COND_RULE>',
"USER_COND_RULE",
'</USER_COND_RULE>',
'<USER_LARGE_BUTTONS>',
"USER_LARGE_BUTTONS",
'</USER_LARGE_BUTTONS>',
'<USER_NOTIFY_NAC>',
"USER_NOTIFY_NAC",
'</USER_NOTIFY_NAC>',
'<VIEW_WORKFLOW>',
"VIEW_WORKFLOW",
'</VIEW_WORKFLOW>',
'</row>'
)
) data_xml
FROM
PUBLIC."AO_D195E9_CONFIG"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_CONDITIONAL_RULE>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_CONDITIONAL_RULE>' ),
11 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<CONDITIONAL_NAME>',
"CONDITIONAL_NAME",
'</CONDITIONAL_NAME>',
'<CONDITIONAL_RULE>',
"CONDITIONAL_RULE",
'</CONDITIONAL_RULE>',
'<ID>',
"ID",
'</ID>',
'<USER_EVALUATOR>',
"USER_EVALUATOR",
'</USER_EVALUATOR>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_CONDITIONAL_RULE"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_CUSTOM_MAIL_TEMPLATE>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_CUSTOM_MAIL_TEMPLATE>' ),
12 AS FILTER
FROM
(
SELECT
CONCAT (
CONCAT (
'<row>',
'<BODY_SECTION>',
REPLACE ( "BODY_SECTION", '&', '&' ),
'</BODY_SECTION>',
'<BUTTON_LINKS_TYPE>',
"BUTTON_LINKS_TYPE",
'</BUTTON_LINKS_TYPE>',
'<BUTTON_TEXTS>',
"BUTTON_TEXTS",
'</BUTTON_TEXTS>',
'<COMMENT_ENABLED>',
"COMMENT_ENABLED",
'</COMMENT_ENABLED>',
'<COMMENT_ENABLED_IF_REQUIRED>',
"COMMENT_ENABLED_IF_REQUIRED",
'</COMMENT_ENABLED_IF_REQUIRED>',
'<CONDITIONAL_RULE_ID>',
"CONDITIONAL_RULE_ID",
'</CONDITIONAL_RULE_ID>',
'<CONDITION_ENABLING_TEMPLATE_ID>',
"CONDITION_ENABLING_TEMPLATE_ID",
'</CONDITION_ENABLING_TEMPLATE_ID>',
'<CUSTOM_APPROVAL_INSTRUCT>',
REPLACE ( "CUSTOM_APPROVAL_INSTRUCT", '&', '&' ),
'</CUSTOM_APPROVAL_INSTRUCT>',
'<CUSTOM_TEMPLATE_NAME>',
"CUSTOM_TEMPLATE_NAME",
'</CUSTOM_TEMPLATE_NAME>',
'<FOOTER>',
"FOOTER",
'</FOOTER>',
'<HEADER>',
"HEADER",
'</HEADER>',
'<HIDE_APPROVAL_BUTTON>',
"HIDE_APPROVAL_BUTTON",
'</HIDE_APPROVAL_BUTTON>',
'<HIDE_APPROVAL_COMMENT>',
"HIDE_APPROVAL_COMMENT",
'</HIDE_APPROVAL_COMMENT>',
'<HIDE_APPROVAL_INSTRUCT>',
"HIDE_APPROVAL_INSTRUCT",
'</HIDE_APPROVAL_INSTRUCT>',
'<HIDE_ASSIGNEE>',
"HIDE_ASSIGNEE",
'</HIDE_ASSIGNEE>',
'<HIDE_COMMENT>',
"HIDE_COMMENT",
'</HIDE_COMMENT>'
),
CONCAT (
'<HIDE_CREATED>',
"HIDE_CREATED",
'</HIDE_CREATED>',
'<HIDE_DESCRIPTION>',
"HIDE_DESCRIPTION",
'</HIDE_DESCRIPTION>',
'<HIDE_ISSUE_TYPE>',
"HIDE_ISSUE_TYPE",
'</HIDE_ISSUE_TYPE>',
'<HIDE_LOGO>',
"HIDE_LOGO",
'</HIDE_LOGO>',
'<HIDE_PRIORITY>',
"HIDE_PRIORITY",
'</HIDE_PRIORITY>',
'<HIDE_PROJECT>',
"HIDE_PROJECT",
'</HIDE_PROJECT>',
'<HIDE_REPORTER>',
"HIDE_REPORTER",
'</HIDE_REPORTER>',
'<HIDE_WORKFLOW_TRANS>',
"HIDE_WORKFLOW_TRANS",
'</HIDE_WORKFLOW_TRANS>',
'<ID>',
"ID",
'</ID>',
'<IS_BOTTOM_BODY_SECTION>',
"IS_BOTTOM_BODY_SECTION",
'</IS_BOTTOM_BODY_SECTION>',
'<IS_BOTTOM_BUTTON>',
"IS_BOTTOM_BUTTON",
'</IS_BOTTOM_BUTTON>',
'<IS_EMAIL_TEMPLATE_DEFAULT>',
"IS_EMAIL_TEMPLATE_DEFAULT",
'</IS_EMAIL_TEMPLATE_DEFAULT>',
'<IS_EMAIL_TEMPLATE_REPLY>',
"IS_EMAIL_TEMPLATE_REPLY",
'</IS_EMAIL_TEMPLATE_REPLY>',
'<PROJECT_ID>',
"PROJECT_ID",
'</PROJECT_ID>',
'<SHOW_LINKED_ISSUES>',
"SHOW_LINKED_ISSUES",
'</SHOW_LINKED_ISSUES>',
'<SHOW_SUBTASKS>',
"SHOW_SUBTASKS",
'</SHOW_SUBTASKS>',
'<SUBJECT>',
REPLACE ( "SUBJECT", '&', '&' ),
'</SUBJECT>',
'<TYPE>',
"TYPE",
'</TYPE>',
'</row>'
)
) data_xml
FROM
PUBLIC."AO_D195E9_CUSTOM_MAIL_TEMPLATE"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_NOT_NOTIFY>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_NOT_NOTIFY>' ),
13 AS FILTER
FROM
(
SELECT
CONCAT ( '<row>', '<ID>', "ID", '</ID>', '<RECIPIENT>', "RECIPIENT", '</RECIPIENT>', '<TYPE>', "TYPE", '</TYPE>', '</row>' ) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_NOT_NOTIFY"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_NTF_SCHEME>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_NTF_SCHEME>' ),
14 AS FILTER
FROM
(
SELECT
CONCAT ( '<row>', '<ID>', "ID", '</ID>', '<DESCRIPTION>', "DESCRIPTION", '</DESCRIPTION>', '<NAME>', "NAME", '</NAME>', '</row>' ) data_xml
FROM
PUBLIC."AO_D195E9_NTF_SCHEME"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_NTF_SCHEME_DETAIL>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_NTF_SCHEME_DETAIL>' ),
15 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<ID>',
"ID",
'</ID>',
'<CUSTOM_MAIL_TEMPLATE_ID>',
"CUSTOM_MAIL_TEMPLATE_ID",
'</CUSTOM_MAIL_TEMPLATE_ID>',
'<EVENT_TYPE_ID>',
"EVENT_TYPE_ID",
'</EVENT_TYPE_ID>',
'<NOTIFY_EXPRESSION>',
"NOTIFY_EXPRESSION",
'</NOTIFY_EXPRESSION>',
'<NTF_SCHEME_ID>',
"NTF_SCHEME_ID",
'</NTF_SCHEME_ID>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_NTF_SCHEME_DETAIL"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_RECIPIENTS>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_RECIPIENTS>' ),
16 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<ID>',
"ID",
'</ID>',
'<EVENTS>',
"EVENTS",
'</EVENTS>',
'<RECIPIENT>',
"RECIPIENT",
'</RECIPIENT>',
'<TYPE>',
"TYPE",
'</TYPE>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_RECIPIENTS"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_PROJECTS>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_PROJECTS>' ),
17 AS FILTER
FROM
(
SELECT
CONCAT ( '<row>', '<ID>', "ID", '</ID>', '<PROJECT_ID>', "PROJECT_ID", '</PROJECT_ID>', '<REQUESTER_TYPE>', "REQUESTER_TYPE", '</REQUESTER_TYPE>', '</row>' ) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_PROJECTS"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_REQUESTERS>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_REQUESTERS>' ),
18 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<ID>',
"ID",
'</ID>',
'<ISSUE_TYPE_ID>',
"ISSUE_TYPE_ID",
'</ISSUE_TYPE_ID>',
'<PROJECT_ID>',
"PROJECT_ID",
'</PROJECT_ID>',
'<REQUESTER>',
"REQUESTER",
'</REQUESTER>',
'<TYPE>',
"TYPE",
'</TYPE>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_REQUESTERS"
WHERE
"TYPE" != 'NOTYPE'
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_DEFINERS>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_DEFINERS>' ),
19 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<ID>',
"ID",
'</ID>',
'<ISSUE_TYPE_ID>',
"ISSUE_TYPE_ID",
'</ISSUE_TYPE_ID>',
'<PROJECT_ID>',
"PROJECT_ID",
'</PROJECT_ID>',
'<DEFINER>',
"DEFINER",
'</DEFINER>',
'<TYPE>',
"TYPE",
'</TYPE>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_DEFINERS"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_MENU_PERM>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_MENU_PERM>' ),
20 AS FILTER
FROM
(
SELECT
CONCAT ( '<row>', '<ID>', "ID", '</ID>', '<ITEM>', "ITEM", '</ITEM>', '<TYPE>', "TYPE", '</TYPE>', '</row>' ) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_MENU_PERM"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_MAPPING>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_MAPPING>' ),
21 AS FILTER
FROM
(
SELECT
CONCAT (
CONCAT (
'<row>',
'<ABSTAIN_ACTION_STATUS>',
"ABSTAIN_ACTION_STATUS",
'</ABSTAIN_ACTION_STATUS>',
'<AREA_COND_RULE_ID>',
"AREA_COND_RULE_ID",
'</AREA_COND_RULE_ID>',
'<AREA_DATE_PICKER>',
"AREA_DATE_PICKER",
'</AREA_DATE_PICKER>',
'<AREA_ELAPSED_TIME>',
"AREA_ELAPSED_TIME",
'</AREA_ELAPSED_TIME>',
'<AREA_SERVICE_NAME>',
"AREA_SERVICE_NAME",
'</AREA_SERVICE_NAME>',
'<ARN>',
"ARN",
'</ARN>',
'<AWT>',
"AWT",
'</AWT>',
'<AWTAD>',
"AWTAD",
'</AWTAD>',
'<AWTR>',
"AWTR",
'</AWTR>',
'<CONDITIONAL_RULE_ID>',
"CONDITIONAL_RULE_ID",
'</CONDITIONAL_RULE_ID>',
'<CONFIG_ID>',
"CONFIG_ID",
'</CONFIG_ID>'
),
CONCAT (
'<DA_DECISION>',
"DA_DECISION",
'</DA_DECISION>',
'<DA_ELAPSED_TIME>',
"DA_ELAPSED_TIME",
'</DA_ELAPSED_TIME>',
'<DA_SERVICE_NAME>',
"DA_SERVICE_NAME",
'</DA_SERVICE_NAME>',
'<DA_USER_KEY>',
"DA_USER_KEY",
'</DA_USER_KEY>',
'<DESTINATION_STATUS_ID>',
"DESTINATION_STATUS_ID",
'</DESTINATION_STATUS_ID>',
'<ID>',
"ID",
'</ID>',
'<ISSUE_TYPE_ID>',
"ISSUE_TYPE_ID",
'</ISSUE_TYPE_ID>',
'<IS_DELETE>',
"IS_DELETE",
'</IS_DELETE>',
'<IS_DRAFT>',
"IS_DRAFT",
'</IS_DRAFT>',
'<IS_LOCKED>',
"IS_LOCKED",
'</IS_LOCKED>',
'<IS_NOT_SINGLE>',
"IS_NOT_SINGLE",
'</IS_NOT_SINGLE>',
'<LOCKED_DATE>',
"LOCKED_DATE",
'</LOCKED_DATE>',
'<LOCKED_INFO>',
"LOCKED_INFO",
'</LOCKED_INFO>'
),
CONCAT (
'<MAIL_TEMPLATE_REPLY_ID>',
"MAIL_TEMPLATE_REPLY_ID",
'</MAIL_TEMPLATE_REPLY_ID>',
'<MAIL_TEMPLATE_REQUEST_ID>',
"MAIL_TEMPLATE_REQUEST_ID",
'</MAIL_TEMPLATE_REQUEST_ID>',
'<MRA>',
"MRA",
'</MRA>',
'<MRR>',
"MRR",
'</MRR>',
'<NAC>',
"NAC",
'</NAC>',
'<ORDER_MAP>',
"ORDER_MAP",
'</ORDER_MAP>',
'<PROJECT_ID>',
"PROJECT_ID",
'</PROJECT_ID>',
'<RAC>',
"RAC",
'</RAC>',
'<RACA>',
"RACA",
'</RACA>',
'<REPLY_NOTIFICATION_SCHEMA_ID>',
"REPLY_NOTIFICATION_SCHEMA_ID",
'</REPLY_NOTIFICATION_SCHEMA_ID>',
'<SA>',
"SA",
'</SA>',
'<SAAD>',
"SAAD",
'</SAAD>',
'<SHOW_APPROVAL_BUTTONS_JSD>',
"SHOW_APPROVAL_BUTTONS_JSD",
'</SHOW_APPROVAL_BUTTONS_JSD>',
'<SHOW_APPROVAL_STATUS_JSD>',
"SHOW_APPROVAL_STATUS_JSD",
'</SHOW_APPROVAL_STATUS_JSD>',
'<SOURCE_STATUS_ID>',
"SOURCE_STATUS_ID",
'</SOURCE_STATUS_ID>',
'<SUPER_APPROVERS_EXPR>',
"SUPER_APPROVERS_EXPR",
'</SUPER_APPROVERS_EXPR>',
'<TRANSITION_ID>',
"TRANSITION_ID",
'</TRANSITION_ID>',
'<TRANSITION_ON_REJECTING>',
"TRANSITION_ON_REJECTING",
'</TRANSITION_ON_REJECTING>',
'</row>'
)
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_MAPPING"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_MAPPING_REL>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_MAPPING_REL>' ),
22 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<APPROVAL_ID>',
"APPROVAL_ID",
'</APPROVAL_ID>',
'<APPROVAL_MAPPING_ID>',
"APPROVAL_MAPPING_ID",
'</APPROVAL_MAPPING_ID>',
'<ID>',
"ID",
'</ID>',
'<IS_OPTIONAL_APPROVAL>',
"IS_OPTIONAL_APPROVAL",
'</IS_OPTIONAL_APPROVAL>',
'<SORT_SA>',
"SORT_SA",
'</SORT_SA>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_MAPPING_REL"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_ISSUE_APPROVAL>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_ISSUE_APPROVAL>' ),
23 AS FILTER
FROM
(
SELECT
CONCAT (
CONCAT (
'<row>',
'<ABSTAIN_ACTION_STATUS>',
"ABSTAIN_ACTION_STATUS",
'</ABSTAIN_ACTION_STATUS>',
'<APPROVAL_ID>',
"APPROVAL_ID",
'</APPROVAL_ID>',
'<APPROVAL_STATUS>',
"APPROVAL_STATUS",
'</APPROVAL_STATUS>',
'<APPROVER_USER>',
"APPROVER_USER",
'</APPROVER_USER>',
'<AREA_COND_RULE_ID>',
"AREA_COND_RULE_ID",
'</AREA_COND_RULE_ID>',
'<AREA_DATE_PICKER>',
"AREA_DATE_PICKER",
'</AREA_DATE_PICKER>',
'<AREA_ELAPSED_TIME>',
"AREA_ELAPSED_TIME",
'</AREA_ELAPSED_TIME>',
'<AREA_SERVICE_NAME>',
"AREA_SERVICE_NAME",
'</AREA_SERVICE_NAME>',
'<ARN>',
"ARN",
'</ARN>',
'<AWT>',
"AWT",
'</AWT>',
'<AWTAD>',
"AWTAD",
'</AWTAD>',
'<AWTR>',
"AWTR",
'</AWTR>',
'<COMMENT_NOTIFICATION_DATE>',
"COMMENT_NOTIFICATION_DATE",
'</COMMENT_NOTIFICATION_DATE>',
'<CONDITIONAL_RULE_ID>',
"CONDITIONAL_RULE_ID",
'</CONDITIONAL_RULE_ID>',
'<CUSTOM_APPROVER>',
"CUSTOM_APPROVER",
'</CUSTOM_APPROVER>'
),
CONCAT (
'<DATE>',
"DATE",
'</DATE>',
'<DA_DECISION>',
"DA_DECISION",
'</DA_DECISION>',
'<DA_ELAPSED_TIME>',
"DA_ELAPSED_TIME",
'</DA_ELAPSED_TIME>',
'<DA_SERVICE_NAME>',
"DA_SERVICE_NAME",
'</DA_SERVICE_NAME>',
'<DA_USER_KEY>',
"DA_USER_KEY",
'</DA_USER_KEY>',
'<DEFINE_CUSTOM_APPROVAL>',
"DEFINE_CUSTOM_APPROVAL",
'</DEFINE_CUSTOM_APPROVAL>',
'<DELEGATOR_KEY>',
"DELEGATOR_KEY",
'</DELEGATOR_KEY>',
'<ERROR_TRANSIT>',
"ERROR_TRANSIT",
'</ERROR_TRANSIT>',
'<ERROR_TRANSIT_TYPE>',
"ERROR_TRANSIT_TYPE",
'</ERROR_TRANSIT_TYPE>',
'<HAS_CONFIG_FOR_SINGLE_ISSUE>',
"HAS_CONFIG_FOR_SINGLE_ISSUE",
'</HAS_CONFIG_FOR_SINGLE_ISSUE>',
'<ID>',
"ID",
'</ID>',
'<ISSUE_ID>',
"ISSUE_ID",
'</ISSUE_ID>',
'<ISSUE_STATUS>',
"ISSUE_STATUS",
'</ISSUE_STATUS>',
'<IS_OPTIONAL_APPROVAL>',
"IS_OPTIONAL_APPROVAL",
'</IS_OPTIONAL_APPROVAL>',
'<MAIL_TEMPLATE_REPLY_ID>',
"MAIL_TEMPLATE_REPLY_ID",
'</MAIL_TEMPLATE_REPLY_ID>'
),
CONCAT (
'<MAIL_TEMPLATE_REQUEST_ID>',
"MAIL_TEMPLATE_REQUEST_ID",
'</MAIL_TEMPLATE_REQUEST_ID>',
'<MRA>',
"MRA",
'</MRA>',
'<MRR>',
"MRR",
'</MRR>',
'<NAC>',
"NAC",
'</NAC>',
'<NOTIFICATION_DATE>',
"NOTIFICATION_DATE",
'</NOTIFICATION_DATE>',
'<RAC>',
"RAC",
'</RAC>',
'<RACA>',
"RACA",
'</RACA>',
'<REPLY_NOTIFICATION_SCHEMA_ID>',
"REPLY_NOTIFICATION_SCHEMA_ID",
'</REPLY_NOTIFICATION_SCHEMA_ID>',
'<SA>',
"SA",
'</SA>',
'<SAAD>',
"SAAD",
'</SAAD>',
'<SHOW_APPROVAL_BUTTONS_JSD>',
"SHOW_APPROVAL_BUTTONS_JSD",
'</SHOW_APPROVAL_BUTTONS_JSD>',
'<SHOW_APPROVAL_STATUS_JSD>',
"SHOW_APPROVAL_STATUS_JSD",
'</SHOW_APPROVAL_STATUS_JSD>',
'<SORT_SA>',
"SORT_SA",
'</SORT_SA>',
'<SOURCE_STATUS_ID>',
"SOURCE_STATUS_ID",
'</SOURCE_STATUS_ID>',
'<SUBMITTED_DATE>',
"SUBMITTED_DATE",
'</SUBMITTED_DATE>',
'<SUPER_APPROVERS_EXPR>',
"SUPER_APPROVERS_EXPR",
'</SUPER_APPROVERS_EXPR>',
'<TRANSITION_ID>',
"TRANSITION_ID",
'</TRANSITION_ID>',
'<TRANSITION_NAME>',
"TRANSITION_NAME",
'</TRANSITION_NAME>',
'<TRANSITION_ON_REJECTING>',
"TRANSITION_ON_REJECTING",
'</TRANSITION_ON_REJECTING>',
'<TYPE>',
"TYPE",
'</TYPE>',
'</row>'
)
) data_xml
FROM
PUBLIC."AO_D195E9_ISSUE_APPROVAL"
WHERE
"TYPE" = 'SINGLE_ISSUE'
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_MRA>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_MRA>' ),
24 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<APPROVAL_MAPPING_ID>',
"APPROVAL_MAPPING_ID",
'</APPROVAL_MAPPING_ID>',
'<CONDITIONAL_RULE_ID>',
"CONDITIONAL_RULE_ID",
'</CONDITIONAL_RULE_ID>',
'<ID>',
"ID",
'</ID>',
'<ISSUE_ID>',
"ISSUE_ID",
'</ISSUE_ID>',
'<MRA>',
"MRA",
'</MRA>',
'<ORDER>',
"ORDER",
'</ORDER>',
'<SOURCE_STATUS_ID>',
"SOURCE_STATUS_ID",
'</SOURCE_STATUS_ID>',
'<TRANSITION_ID>',
"TRANSITION_ID",
'</TRANSITION_ID>',
'<TYPE>',
"TYPE",
'</TYPE>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_MRA"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_HISTORY>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_HISTORY>' ),
25 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<ACTION>',
"ACTION",
'</ACTION>',
'<APPROVAL_COMMENT>',
"APPROVAL_COMMENT",
'</APPROVAL_COMMENT>',
'<APPROVAL_DETAIL>',
"APPROVAL_DETAIL",
'</APPROVAL_DETAIL>',
'<APPROVAL_NAME>',
"APPROVAL_NAME",
'</APPROVAL_NAME>',
'<COMMENT>',
"COMMENT",
'</COMMENT>',
'<DATE>',
"DATE",
'</DATE>',
'<DELEGATOR_KEY>',
"DELEGATOR_KEY",
'</DELEGATOR_KEY>',
'<DESTINATION_STATUS>',
"DESTINATION_STATUS",
'</DESTINATION_STATUS>',
'<EXECUTOR>',
"EXECUTOR",
'</EXECUTOR>',
'<EXECUTOR_KEY>',
"EXECUTOR_KEY",
'</EXECUTOR_KEY>',
'<ID>',
"ID",
'</ID>',
'<ISSUE_ID>',
"ISSUE_ID",
'</ISSUE_ID>',
'<NOTIFICATION_DATE>',
"NOTIFICATION_DATE",
'</NOTIFICATION_DATE>',
'<SOURCE_STATUS>',
"SOURCE_STATUS",
'</SOURCE_STATUS>',
'<SUBMITTED_DATE>',
"SUBMITTED_DATE",
'</SUBMITTED_DATE>',
'<TRANSITION_NAME>',
"TRANSITION_NAME",
'</TRANSITION_NAME>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_HISTORY"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_APPROVAL_DELEGATED>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_APPROVAL_DELEGATED>' ),
26 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<DELEGATED_KEY>',
"DELEGATED_KEY",
'</DELEGATED_KEY>',
'<DELEGATOR_KEY>',
"DELEGATOR_KEY",
'</DELEGATOR_KEY>',
'<END_DATE>',
"END_DATE",
'</END_DATE>',
'<ID>',
"ID",
'</ID>',
'<ISSUE_TYPE_ID>',
"ISSUE_TYPE_ID",
'</ISSUE_TYPE_ID>',
'<PROJECT_ID>',
"PROJECT_ID",
'</PROJECT_ID>',
'<SEND_APPROVAL_REQUESTS>',
"SEND_APPROVAL_REQUESTS",
'</SEND_APPROVAL_REQUESTS>',
'<START_DATE>',
"START_DATE",
'</START_DATE>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_APPROVAL_DELEGATED"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_LANGUAGE_PACK>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_LANGUAGE_PACK>' ),
27 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<DESCRIPTION>',
"DESCRIPTION",
'</DESCRIPTION>',
'<ENABLED>',
"ENABLED",
'</ENABLED>',
'<ID>',
"ID",
'</ID>',
'<LOCALE>',
"LOCALE",
'</LOCALE>',
'<MODIFIED_DATE>',
"MODIFIED_DATE",
'</MODIFIED_DATE>',
'<MODIFIED_USER>',
"MODIFIED_USER",
'</MODIFIED_USER>',
'<NAME>',
"NAME",
'</NAME>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_LANGUAGE_PACK"
) AS RESULT UNION
SELECT
concat ( '<AO_D195E9_LANG_PACK_KEY_VAL>', STRING_AGG ( RESULT.data_xml, '' ), '</AO_D195E9_LANG_PACK_KEY_VAL>' ),
28 AS FILTER
FROM
(
SELECT
CONCAT (
'<row>',
'<ID>',
"ID",
'</ID>',
'<LANGUAGE_PACK_ID>',
"LANGUAGE_PACK_ID",
'</LANGUAGE_PACK_ID>',
'<PROPERTY_KEY>',
"PROPERTY_KEY",
'</PROPERTY_KEY>',
'<VALUE>',
regexp_replace( "VALUE", E'<.*?>', '', 'g' ),
'</VALUE>',
'</row>'
) data_xml
FROM
PUBLIC."AO_D195E9_LANG_PACK_KEY_VAL"
WHERE
"LANGUAGE_PACK_ID" IN ( SELECT "ID" FROM PUBLIC."AO_D195E9_LANGUAGE_PACK" WHERE "LOCALE" IS NOT NULL )
) AS RESULT
ORDER BY
FILTER
|