From 750c9f10b950f202a001706d1396cf3ad4973386 Mon Sep 17 00:00:00 2001 From: Maxim Smirnov Date: Wed, 19 Feb 2020 16:06:47 +0300 Subject: [PATCH] HCX-10 Add custom fields in create and update in PlanadoV2 class --- CHANGELOG.md | 3 +- .../latera/bss/connectors/PlanadoV2.groovy | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9188c2ca..fa2db06a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,9 +12,10 @@ v1.4.2 [unreleased] - [#38](https://github.com/latera/camunda-ext/pull/38) Add method for job updating into PlanadoV2 class - [#33](https://github.com/latera/camunda-ext/pull/33) Allow to pass goodValueId into hid.Hydra#getGoodAddParamsBy - [#24](https://github.com/latera/camunda-ext/pull/24) Add methods for files to document attaching +- [#39](https://github.com/latera/camunda-ext/pull/39) Add custom fields in create and update methods in PlanadoV2 class ### Bugfixes -- [#27](https://github.com/latera/camunda-ext/pull/27) Remove redundant get methods from hid.Hydra class +- [#27](https://github.com/latera/camunda-ext/pull/27) Remove redundant get methods from hid.Hydra class - [#28](https://github.com/latera/camunda-ext/pull/28) Fix return types of HID class methods - [#30](https://github.com/latera/camunda-ext/pull/30) Fix wrong Self-Care app id passing into method calls - [#26](https://github.com/latera/camunda-ext/pull/26) Fix passing appCode into hid.Hydra#mainInit method diff --git a/src/org/camunda/latera/bss/connectors/PlanadoV2.groovy b/src/org/camunda/latera/bss/connectors/PlanadoV2.groovy index 224261b3..6a609f3a 100644 --- a/src/org/camunda/latera/bss/connectors/PlanadoV2.groovy +++ b/src/org/camunda/latera/bss/connectors/PlanadoV2.groovy @@ -166,17 +166,17 @@ class PlanadoV2 { LinkedHashMap payload = [ external_id : extId, organization : true, - organization_name : data.companyName ?: '', + organization_name : data.companyName ?: '', site_address : [ - formatted : data.addressStreet ?: '', - entrance_no : data.addressEntrance ?: '', - floor : data.addressFloor ?: '', - apartment : data.addressApartment ?: '', - description : data.addressDescription ?: '' + formatted : data.addressStreet ?: '', + entrance_no : data.addressEntrance ?: '', + floor : data.addressFloor ?: '', + apartment : data.addressApartment ?: '', + description : data.addressDescription ?: '' ], contacts : [[ - name : data.contactName ?: '', - value : data.phone ?: '', + name : data.contactName ?: '', + value : data.phone ?: '', type : 'phone' ]] ] @@ -203,10 +203,11 @@ class PlanadoV2 { } LinkedHashMap payload = [ - template_id : toIntSafe(data.templateId), - client_id : data.clientId, - scheduled_at : data.startDate, - description : data.description ?: '' + template_id : toIntSafe(data.templateId), + client_id : data.clientId, + scheduled_at : data.startDate, + description : data.description ?: '', + custom_fields : data.customFields ?: [] ] logger.info('Creating new job') @@ -221,6 +222,9 @@ class PlanadoV2 { if (data.containsKey('description')) { description = data.description } + if (data.containsKey('customFields')) { + custom_fields = data.customFields + } it }