From b028e7ec4121b257aa13164a2436a4088bf004d6 Mon Sep 17 00:00:00 2001 From: Vishnu-rvk <85154620+Vishnu-rvk@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:38:02 +0530 Subject: [PATCH 1/4] Create Task Creating task when button is clicked with the same details added in Incident ticket. --- UI Actions/Create Task | 1 + 1 file changed, 1 insertion(+) create mode 100644 UI Actions/Create Task diff --git a/UI Actions/Create Task b/UI Actions/Create Task new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/UI Actions/Create Task @@ -0,0 +1 @@ + From 922fdb88f2f5bdc2f228b4c82082a61de728cc68 Mon Sep 17 00:00:00 2001 From: Vishnu-rvk <85154620+Vishnu-rvk@users.noreply.github.com> Date: Tue, 7 Oct 2025 18:40:07 +0530 Subject: [PATCH 2/4] Fetch dynamic value from decision table If we want to have a scenario like based on "FieldA" of big list of comma separated values, We need to provide its relevant "FieldB" value, Which need not to be repeated again and the key value pair is huge and often changing, In that case we can make use of decision table to fetch key value pair without interrupting any scripts and saving value in "FieldB" which will get changed according to "FieldA" value as it is a calculated field. --- .../code.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Server-Side Components/Server Side/Fetch dynamic value from decision table/code.js diff --git a/Server-Side Components/Server Side/Fetch dynamic value from decision table/code.js b/Server-Side Components/Server Side/Fetch dynamic value from decision table/code.js new file mode 100644 index 0000000000..39cd9e6577 --- /dev/null +++ b/Server-Side Components/Server Side/Fetch dynamic value from decision table/code.js @@ -0,0 +1,31 @@ +(function calculatedFieldValue(current) { + + var fieldA = current.u_list_items.toString(); // Get value of field 1 + + if (fieldA != '') { // Check if field value is empty + + var individualInformation = fieldA.split(","); + var resultElements = []; + for (var i in individualInformation) { + try { + var inputs = {}; + inputs['u_decision_field'] = individualInformation[i]; + + var dt = new sn_dt.DecisionTableAPI(); // Calling decision table by API call + var response = dt.getDecision('sysid_of_decision_table', inputs); + + var result_elements = response.result_elements; + var u_return_value = result_elements.u_decision_result.getValue(); // String + if (resultElements.indexOf(u_return_value) == -1) + resultElements.push(u_return_value); + + } catch (e) { + gs.log("Couldn't run this script Error: " + e); + resultElements.push(''); + } + + } + return resultElements.toString(); // Return end result as string to get stored in field 2 + + } +})(current); From 920f136da77f9b1d6b34114b1e47784285dd6a4a Mon Sep 17 00:00:00 2001 From: Vishnu-rvk <85154620+Vishnu-rvk@users.noreply.github.com> Date: Tue, 7 Oct 2025 18:45:47 +0530 Subject: [PATCH 3/4] README.md Read me file for calculated field using decision builder --- .../Fetch dynamic value from decision table/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Server-Side Components/Server Side/Fetch dynamic value from decision table/README.md diff --git a/Server-Side Components/Server Side/Fetch dynamic value from decision table/README.md b/Server-Side Components/Server Side/Fetch dynamic value from decision table/README.md new file mode 100644 index 0000000000..aa98af3b3b --- /dev/null +++ b/Server-Side Components/Server Side/Fetch dynamic value from decision table/README.md @@ -0,0 +1,5 @@ +Fetch dynamic value from decision table + +Use case: Map relevant values of field1 to field2 with large list of choices and often changing and needs to be editable by specific admin team. + +Solution: If we want to have a scenario like based on "Field1" of big list of comma separated values, We need to provide its relevant "Field2" value, Which need not to be repeated again and the key value pair is huge and often changing, In that case we can make use of decision table to fetch key value pair without interrupting any scripts and saving value in "Field2" which will get changed according to "Field1" value as it is a calculated field. From c3c367b5e167ee1aebf074e3fec08fdf5305469d Mon Sep 17 00:00:00 2001 From: Earl Duque <31702109+earlduque@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:21:39 -0700 Subject: [PATCH 4/4] Delete UI Actions/Create Task --- UI Actions/Create Task | 1 - 1 file changed, 1 deletion(-) delete mode 100644 UI Actions/Create Task diff --git a/UI Actions/Create Task b/UI Actions/Create Task deleted file mode 100644 index 8b13789179..0000000000 --- a/UI Actions/Create Task +++ /dev/null @@ -1 +0,0 @@ -