From 92934159c7950b99afef81b56553cbcb35d680a1 Mon Sep 17 00:00:00 2001 From: shahminiaru <86762255+shahminiaru@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:25:36 +0800 Subject: [PATCH] shahmini cp4i epic3358 [5] Batch 5 Adding templates for existing connectors; total 10 UCs --- ...s who have completed the registration.yaml | 141 ++++++++ ...issue is created or updated in GitHub.yaml | 262 ++++++++++++++ ...sync any existing employee to IBM Db2.yaml | 213 +++++++++++ ...racle HCM based on their joining date.yaml | 283 +++++++++++++++ ... when a case is created in Salesforce.yaml | 58 +++ ...st is created for the user in Zendesk.yaml | 106 ++++++ ...mazon EC2 event with instance details.yaml | 262 ++++++++++++++ ...or each ticket retrieved from Zendesk.yaml | 185 ++++++++++ ...w Salesforce cases with GitHub issues.yaml | 160 ++++++++ ...e from the user for more than 3 days.yaml" | 342 ++++++++++++++++++ 10 files changed, 2012 insertions(+) create mode 100644 resources/Create a Google Calendar when a campaign is created in Salesforce for members who have completed the registration.yaml create mode 100644 resources/Create a comment in GitHub with a knowledge article from ServiceNow when an issue is created or updated in GitHub.yaml create mode 100644 resources/Create a new employee in IBM Db2 for each worker retrieved from Oracle HCM and sync any existing employee to IBM Db2.yaml create mode 100644 resources/Create an incident in ServiceNow for each worker retrieved from Oracle HCM based on their joining date.yaml create mode 100644 resources/Create an issue in GitHub when a case is created in Salesforce.yaml create mode 100644 resources/Delete a user from Microsoft Azure Active Directory when an offboarding request is created for the user in Zendesk.yaml create mode 100644 resources/Launch an Amazon EC2 instance and send a Gmail message to the attendees of the Amazon EC2 event with instance details.yaml create mode 100644 resources/Send a Gmail message to the Zendesk user for each ticket retrieved from Zendesk.yaml create mode 100644 resources/Sync new Salesforce cases with GitHub issues.yaml create mode 100644 "resources/Update a ticket to closed status in Zendesk for tickets that didn\342\200\231t have a response from the user for more than 3 days.yaml" diff --git a/resources/Create a Google Calendar when a campaign is created in Salesforce for members who have completed the registration.yaml b/resources/Create a Google Calendar when a campaign is created in Salesforce for members who have completed the registration.yaml new file mode 100644 index 000000000..9a0750589 --- /dev/null +++ b/resources/Create a Google Calendar when a campaign is created in Salesforce for members who have completed the registration.yaml @@ -0,0 +1,141 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + CREATED: + input-context: + data: Campaign + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: {} + connector-type: salesforce + + action-interfaces: + action-interface-3: + type: api-action + business-object: CampaignMember + connector-type: salesforce + account-name: Account 1 + actions: + RETRIEVEALL: {} + action-interface-1: + type: api-action + business-object: events + connector-type: googlecalendar + actions: + CREATE: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Salesforce Retrieve campaign members + target: + $ref: '#/integration/action-interfaces/action-interface-3' + filter: + where: + CampaignId: '{{$Trigger.Id}}' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: false + pagination-type: TOKEN + allow-empty-output: false + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$SalesforceRetrievecampaignmembers ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrievecampaignmembers + $ref: >- + #/node-output/Salesforce Retrieve campaign + members/response/payload + - variable: SalesforceRetrievecampaignmembersMetadata + $ref: >- + #/node-output/Salesforce Retrieve campaign + members/response + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Salesforce Campaign Member + assembly-2: + assembly: + execute: + - if: + name: If + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrievecampaignmembers + $ref: >- + #/node-output/Salesforce Retrieve campaign + members/response/payload + - variable: SalesforceRetrievecampaignmembersMetadata + $ref: '#/node-output/Salesforce Retrieve campaign members/response' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$Trigger.Status}}': Completed + execute: + - create-action: + name: Google Calendar Create event + target: + $ref: '#/integration/action-interfaces/action-interface-1' + map: + mappings: + - attendees: + foreach: + input: '[0]' + iterator: attendeesItem + mappings: + - email: + template: '{{$Foreachitem.Email}}' + - endTime: + template: '2023-09-05 11:00:00' + - id: + template: >- + tbp52a61ab1teqs5lpo1qte2lk@group.calendar.google.com + - startTime: + template: '2023-09-05 10:00:00' + - summary: + template: '{{$Trigger.Name}}' + - timeZone: + template: Asia/Kolkata + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceRetrievecampaignmembers + $ref: >- + #/node-output/Salesforce Retrieve campaign + members/response/payload + - variable: SalesforceRetrievecampaignmembersMetadata + $ref: >- + #/node-output/Salesforce Retrieve campaign + members/response + - variable: flowDetails + $ref: '#/flowDetails' + else: + execute: [] + output-schema: {} + name: Create a Google Calendar when a campaign is created in Salesforce for members who have completed the registration +models: {} diff --git a/resources/Create a comment in GitHub with a knowledge article from ServiceNow when an issue is created or updated in GitHub.yaml b/resources/Create a comment in GitHub with a knowledge article from ServiceNow when an issue is created or updated in GitHub.yaml new file mode 100644 index 000000000..f5f495829 --- /dev/null +++ b/resources/Create a comment in GitHub with a knowledge article from ServiceNow when an issue is created or updated in GitHub.yaml @@ -0,0 +1,262 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + CREATEDORUPDATED_POLLER: + input-context: + data: Issue + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + OwnerName: non-ibm-primary + RepoName: pratiktest + parentFilter: + OwnerName: non-ibm-primary + RepoName: pratiktest + subscription: + createdField: updated_at + updatedField: updated_at + timeFormat: YYYY-MM-DDTHH:mm:ss.SSSZ + timeZone: UTC + pollingInterval: 1 + connector-type: github + action-interfaces: + action-interface-1: + type: api-action + business-object: kb_knowledge + connector-type: servicenow + actions: + RETRIEVEALL: {} + action-interface-2: + type: api-action + business-object: message + connector-type: slack + actions: + CREATE: {} + action-interface-3: + type: api-action + business-object: Comment + connector-type: github + actions: + CREATE: {} + assemblies: + assembly-1: + assembly: + execute: + - if: + name: If + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$Trigger.milestone1.created_at}}': '{{$Trigger.milestone1.updated_at}}' + execute: + - set-variable: + name: Set variable + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`variable`: + type: object + properties: + Labels: + type: array + items: + type: object + properties: + Name: + type: string + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + mappings: + - variable: + mappings: + - Labels: + foreach: + input: '$Trigger.labels1 ' + iterator: LabelsItem + mappings: + - Name: + template: '{{$LabelsItem.name}}' + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$Setvariable.variable.Labels ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable + $ref: >- + #/block/If/node-output/Set + variable/response/payload + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Issue Labels + else: + execute: [] + output-schema: {} + assembly-2: + assembly: + execute: + - retrieve-action: + name: ServiceNow Retrieve knowledge + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + where: + short_description: + contains: '{{$Foreachitem.Name}}' + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable + $ref: '#/block/If/node-output/Set variable/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 2 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: true + - set-variable: + name: Set variable 2 + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`variable`: + type: object + properties: + KB_Article: + type: array + items: + type: object + properties: + ShortDescription: + type: string + Description: + type: string + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ServiceNowRetrieveknowledge + $ref: >- + #/block/For each/node-output/ServiceNow Retrieve + knowledge/response/payload + - variable: ServiceNowRetrieveknowledgeMetadata + $ref: >- + #/block/For each/node-output/ServiceNow Retrieve + knowledge/response + - variable: Setvariable + $ref: '#/block/If/node-output/Set variable/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + mappings: + - variable: + mappings: + - KB_Article: + foreach: + input: '$ServiceNowRetrieveknowledge ' + iterator: KB_ArticleItem + mappings: + - Description: + template: '{{$KB_ArticleItem.description}}' + - ShortDescription: + template: '{{$KB_ArticleItem.short_description}}' + - create-action: + name: Slack Send message + target: + $ref: '#/integration/action-interfaces/action-interface-2' + map: + mappings: + - OBJECT_ID: + template: C04KMH8MALT + - OBJECT_NAME: + template: channel + - text: + template: Response ----> {{$Setvariable2.variable.KB_Article[0]}} + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ServiceNowRetrieveknowledge + $ref: >- + #/block/For each/node-output/ServiceNow Retrieve + knowledge/response/payload + - variable: ServiceNowRetrieveknowledgeMetadata + $ref: >- + #/block/For each/node-output/ServiceNow Retrieve + knowledge/response + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: Setvariable + $ref: '#/block/If/node-output/Set variable/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + - create-action: + name: GitHub Create comment + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - IssueNumber: + template: '{{$Trigger.title}}' + - OwnerName: + template: non-ibm-primary + - RepoName: + template: pratiktest + - body: + template: >- + Kindly refer the below knowledge article/s + -------------------------- + {{$Setvariable2.variable.KB_Article[0]}} + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ServiceNowRetrieveknowledge + $ref: >- + #/block/For each/node-output/ServiceNow Retrieve + knowledge/response/payload + - variable: ServiceNowRetrieveknowledgeMetadata + $ref: >- + #/block/For each/node-output/ServiceNow Retrieve + knowledge/response + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: SlackSendmessage + $ref: >- + #/block/For each/node-output/Slack Send + message/response/payload + - variable: Setvariable + $ref: '#/block/If/node-output/Set variable/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + name: Create a comment in GitHub with a knowledge article from ServiceNow when an issue is created or updated in GitHub +models: {} diff --git a/resources/Create a new employee in IBM Db2 for each worker retrieved from Oracle HCM and sync any existing employee to IBM Db2.yaml b/resources/Create a new employee in IBM Db2 for each worker retrieved from Oracle HCM and sync any existing employee to IBM Db2.yaml new file mode 100644 index 000000000..4b28b3dbe --- /dev/null +++ b/resources/Create a new employee in IBM Db2 for each worker retrieved from Oracle HCM and sync any existing employee to IBM Db2.yaml @@ -0,0 +1,213 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + connector-type: streaming-connector-scheduler + type: event-trigger + triggers: + SCHEDULE: + input-context: + data: scheduler + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + subscription: + scheduleConfiguration: + calendar: + cronExp: 30 09 * * * + runOnceOncheck: false + timeZone: UTC + every: day + action-interfaces: + action-interface-1: + type: api-action + business-object: worker + connector-type: oraclehcm + actions: + RETRIEVEALL: {} + action-interface-3: + type: api-action + business-object: CCTTEST_EMPLOYEE + connector-type: db2 + actions: + CREATE: {} + account-info: + dbType: IBM Db2 Linux, UNIX, or Windows (LUW) - client managed + action-interface-4: + type: api-action + business-object: CCTTEST_WORK_RELATIONSHIPS + connector-type: db2 + actions: + CREATE: {} + account-info: + dbType: IBM Db2 Linux, UNIX, or Windows (LUW) - client managed + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Oracle Human Capital Management Retrieve workers + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + limit: 100 + allow-truncation: true + pagination-type: SKIP_LIMIT + allow-empty-output: true + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$OracleHumanCapitalManagementRetrieveworkers ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response/payload + - variable: OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Oracle Human Capital Management worker + tags: + - incomplete + assembly-2: + assembly: + execute: + - if: + name: If + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$OracleHumanCapitalManagementRetrieveworkerassignments.AdditionalProperties.CreationDate}}': + gte: '{{$Trigger.lastEventTime}}' + execute: + - create-action: + name: IBM Db2 Create EMPLOYEE record 2 + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - DOB: + template: '{{$Foreachitem.DateOfBirth}}' + - EMAIL: + template: >- + {{$Foreachitem.AdditionalProperties.emails.EmailAddress}} + - EMPLOYER: + template: >- + {{$Foreachitem.workRelationships[0].LegalEmployerName}} + - EMP_ID: + template: '{{$Foreachitem.WorkerUniqueId}}' + - FIRST_NAME: + template: '{{$Foreachitem.FullName}}' + - PERSON_ID: + expression: '$Foreachitem.PersonId ' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management + Retrieve workers/response/payload + - variable: >- + OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management + Retrieve workers/response + - variable: flowDetails + $ref: '#/flowDetails' + - if: + name: If 2 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$Foreachitem.AdditionalProperties}}': + neq: '' + execute: + - create-action: + name: IBM Db2 Create WORK_RELATIONSHIPS record + target: + $ref: >- + #/integration/action-interfaces/action-interface-4 + map: + mappings: + - CREATEDBY: + template: >- + {{$Foreachitem.AdditionalProperties.workRelationships.StartDate}} + - EMP_ID: + template: '{{$Foreachitem.WorkerUniqueId}}' + - ENTERPRISESENIORITYDATE: + template: >- + {{$Foreachitem.AdditionalProperties.workRelationships.EnterpriseSeniorityDate}} + - LEGALEMPLOYERNAME: + template: >- + {{$Foreachitem.AdditionalProperties.workRelationships.LegalEmployerName}} + - LEGALENTITYID: + template: >- + {{$Foreachitem.AdditionalProperties.workRelationships.LegalEntityId}} + - LEGISLATIONCODE: + template: >- + {{$Foreachitem.AdditionalProperties.workRelationships.LegislationCode}} + - STARTDATE: + template: >- + {{$Foreachitem.AdditionalProperties.workRelationships.StartDate}} + - WORKTYPE: + template: >- + {{$Foreachitem.AdditionalProperties.workRelationships.WorkerType}} + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: IBMDb2CreateEMPLOYEErecord2 + $ref: >- + #/block/If/node-output/IBM Db2 Create + EMPLOYEE record 2/response/payload + - variable: >- + OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital + Management Retrieve + workers/response/payload + - variable: >- + OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital + Management Retrieve workers/response + - variable: flowDetails + $ref: '#/flowDetails' + else: + execute: [] + output-schema: {} + else: + execute: [] + output-schema: {} + name: Create a new employee in IBM Db2 for each worker retrieved from Oracle HCM and sync any existing employee to IBM Db2 +models: {} diff --git a/resources/Create an incident in ServiceNow for each worker retrieved from Oracle HCM based on their joining date.yaml b/resources/Create an incident in ServiceNow for each worker retrieved from Oracle HCM based on their joining date.yaml new file mode 100644 index 000000000..0b165c88c --- /dev/null +++ b/resources/Create an incident in ServiceNow for each worker retrieved from Oracle HCM based on their joining date.yaml @@ -0,0 +1,283 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + connector-type: streaming-connector-scheduler + type: event-trigger + triggers: + SCHEDULE: + input-context: + data: scheduler + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + subscription: + scheduleConfiguration: + calendar: + cronExp: 00 09 * * * + runOnceOncheck: true + timeZone: UTC + every: day + action-interfaces: + action-interface-1: + type: api-action + business-object: worker + connector-type: oraclehcm + actions: + RETRIEVEALL: {} + action-interface-3: + type: api-action + business-object: Users + connector-type: azuread + actions: + CREATE: {} + action-interface-2: + type: api-action + business-object: incident + connector-type: servicenow + actions: + CREATE: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Oracle Human Capital Management Retrieve workers + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + limit: 10 + allow-truncation: true + pagination-type: SKIP_LIMIT + allow-empty-output: true + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$OracleHumanCapitalManagementRetrieveworkers ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response/payload + - variable: OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Oracle Human Capital Management worker + assembly-2: + assembly: + execute: + - set-variable: + name: Set variable + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`variable`: + type: object + properties: + Projected_start_date: + type: number + Current_time_converted: + type: number + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response/payload + - variable: OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response + - variable: flowDetails + $ref: '#/flowDetails' + mappings: + - variable: + mappings: + - Current_time_converted: + expression: $number($toMillis($Trigger.currentEventTime)) + - Projected_start_date: + expression: >- + $number($toMillis($Foreachitem.AdditionalProperties.Projectedstartdate)) + - set-variable: + name: Set variable 2 + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`variable`: + type: object + properties: + Sub_7days_before_joining: + type: number + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable + $ref: '#/block/For each/node-output/Set variable/response/payload' + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response/payload + - variable: OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response + - variable: flowDetails + $ref: '#/flowDetails' + mappings: + - variable: + mappings: + - Sub_7days_before_joining: + expression: >- + $number(604800000-$Setvariable.variable.Current_time_converted + ) + - if: + name: If + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable + $ref: '#/block/For each/node-output/Set variable/response/payload' + - variable: Setvariable2 + $ref: '#/block/For each/node-output/Set variable 2/response/payload' + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response/payload + - variable: OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management Retrieve + workers/response + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$Setvariable.variable.Current_time_converted}}': + gte: '{{$Setvariable2.variable.Sub_7days_before_joining}}' + execute: + - create-action: + name: Microsoft Azure Active Directory Create user + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - accountEnabled: + expression: 'true' + - displayName: + template: '{{$Foreachitem.DisplayName}}' + - givenName: + template: '{{$Foreachitem.names.FirstName[0]}}' + - mailNickname: + template: xyz.com + - passwordProfile: + mappings: + - forceChangePasswordNextSignIn: + expression: 'true' + - forceChangePasswordNextSignInWithMfa: + expression: 'false' + - password: + template: '{{$Foreachitem.DisplayName}}' + - surname: + template: '{{$Foreachitem.names.LastName[0]}}' + - userPrincipalName: + template: >- + {{$Foreachitem.names.FirstName[0]}}_{{$Foreachitem.names.LastName[0]}} + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable + $ref: >- + #/block/For each/node-output/Set + variable/response/payload + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management + Retrieve workers/response/payload + - variable: >- + OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management + Retrieve workers/response + - variable: flowDetails + $ref: '#/flowDetails' + - create-action: + name: ServiceNow Create incident + target: + $ref: '#/integration/action-interfaces/action-interface-2' + map: + mappings: + - approval: + template: approved + - category: + template: hardware + - route_reason: + expression: '1' + - severity: + expression: '1' + - short_description: + template: >- + please allocate space for + {{$Foreachitem.names.FirstName[0]}} and + {{$Foreachitem.names.LastName[0]}} + - state: + expression: '7' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: MicrosoftAzureActiveDirectoryCreateuser + $ref: >- + #/block/If/node-output/Microsoft Azure Active + Directory Create user/response/payload + - variable: Setvariable + $ref: >- + #/block/For each/node-output/Set + variable/response/payload + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: OracleHumanCapitalManagementRetrieveworkers + $ref: >- + #/node-output/Oracle Human Capital Management + Retrieve workers/response/payload + - variable: >- + OracleHumanCapitalManagementRetrieveworkersMetadata + $ref: >- + #/node-output/Oracle Human Capital Management + Retrieve workers/response + - variable: flowDetails + $ref: '#/flowDetails' + else: + execute: [] + output-schema: {} + name: Create an incident in ServiceNow for each worker retrieved from Oracle HCM based on their joining date +models: {} diff --git a/resources/Create an issue in GitHub when a case is created in Salesforce.yaml b/resources/Create an issue in GitHub when a case is created in Salesforce.yaml new file mode 100644 index 000000000..2fa31c1ec --- /dev/null +++ b/resources/Create an issue in GitHub when a case is created in Salesforce.yaml @@ -0,0 +1,58 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + CREATED: + input-context: + data: Case + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: {} + connector-type: salesforce + action-interfaces: + action-interface-1: + type: api-action + business-object: Issue + connector-type: github + actions: + CREATE: {} + assemblies: + assembly-1: + assembly: + execute: + - create-action: + name: GitHub Create issue + target: + $ref: '#/integration/action-interfaces/action-interface-1' + map: + mappings: + - OwnerName: + template: non-ibm-primary + - RepoName: + template: pratiktest + - body: + template: >- + CaseID: {{$Trigger.Id}}, CaseNumber: + {{$Trigger.CaseNumber}}, CaseType: {{$Trigger.Type}}, + CaseReason: {{$Trigger.Reason}}, CaseOrigin: + {{$Trigger.Origin}}, Name: {{$Trigger.SuppliedName}}, + Email: {{$Trigger.SuppliedEmail}}, Phone: + {{$Trigger.SuppliedPhone}}, Company: + {{$Trigger.SuppliedCompany}}, Product: + {{$Trigger.Product__c}}, Potential Liability: + {{$Trigger.PotentialLiability__c}} + - labels: + expression: '["Salesforce Case"]' + - title: + template: '{{$Trigger.Subject}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + name: Create an issue in GitHub when a case is created in Salesforce +models: {} diff --git a/resources/Delete a user from Microsoft Azure Active Directory when an offboarding request is created for the user in Zendesk.yaml b/resources/Delete a user from Microsoft Azure Active Directory when an offboarding request is created for the user in Zendesk.yaml new file mode 100644 index 000000000..fe554df0b --- /dev/null +++ b/resources/Delete a user from Microsoft Azure Active Directory when an offboarding request is created for the user in Zendesk.yaml @@ -0,0 +1,106 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + CREATED_POLLER: + input-context: + data: Ticket + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + subscription: + createdField: created_at + updatedField: updated_at + timeFormat: YYYY-MM-DDTHH:mm:ss.SSSZ + timeZone: UTC + pollingInterval: 1 + isCreatedQueryable: true + connector-type: zendeskservice + action-interfaces: + action-interface-1: + type: api-action + business-object: Users + connector-type: azuread + actions: + RETRIEVEALL: {} + action-interface-2: + type: api-action + business-object: Users + connector-type: azuread + actions: + DELETEALL: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Microsoft Azure Active Directory Retrieve users + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + where: + mail: '{{$Trigger.ticket_fields.id__21959543171737}}' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: true + - if: + name: If + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: MicrosoftAzureActiveDirectoryRetrieveusers + $ref: >- + #/node-output/Microsoft Azure Active Directory Retrieve + users/response/payload + - variable: MicrosoftAzureActiveDirectoryRetrieveusersMetadata + $ref: >- + #/node-output/Microsoft Azure Active Directory Retrieve + users/response + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + and: + - '{{$Trigger.ticket_fields.id__21959434346521}}': + '=': 'true' + - '{{$MicrosoftAzureActiveDirectoryRetrieveusersMetadata."status-code"}}': '200' + hashKey: object:883 + execute: + - delete-action: + name: Microsoft Azure Active Directory Delete user + target: + $ref: '#/integration/action-interfaces/action-interface-2' + filter: + where: + id: >- + {{$MicrosoftAzureActiveDirectoryRetrieveusers[0].id}} + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: MicrosoftAzureActiveDirectoryRetrieveusers + $ref: >- + #/node-output/Microsoft Azure Active Directory + Retrieve users/response/payload + - variable: >- + MicrosoftAzureActiveDirectoryRetrieveusersMetadata + $ref: >- + #/node-output/Microsoft Azure Active Directory + Retrieve users/response + - variable: flowDetails + $ref: '#/flowDetails' + limit: 1 + allow-empty-output: true + else: + execute: [] + output-schema: {} + name: Delete a user from Microsoft Azure Active Directory when an offboarding request is created for the user in Zendesk +models: {} diff --git a/resources/Launch an Amazon EC2 instance and send a Gmail message to the attendees of the Amazon EC2 event with instance details.yaml b/resources/Launch an Amazon EC2 instance and send a Gmail message to the attendees of the Amazon EC2 event with instance details.yaml new file mode 100644 index 000000000..585dc4ecc --- /dev/null +++ b/resources/Launch an Amazon EC2 instance and send a Gmail message to the attendees of the Amazon EC2 event with instance details.yaml @@ -0,0 +1,262 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + SCHEDULE: + input-context: + data: scheduler + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + subscription: + scheduleConfiguration: + calendar: + cronExp: 00 09 * * * + runOnceOncheck: true + timeZone: UTC + every: day + connector-type: streaming-connector-scheduler + action-interfaces: + action-interface-1: + type: api-action + business-object: events + connector-type: googlecalendar + actions: + RETRIEVEALL: {} + action-interface-2: + type: api-action + business-object: Instance + connector-type: amazonec2 + actions: + LAUNCHINSTANCES: {} + action-interface-3: + type: api-action + business-object: mail + connector-type: gmail + actions: + CREATE: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Google Calendar Retrieve events + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + where: + and: + - fromDate: '{{$Trigger.currentEventTime}}' + - id: appconnectpsl999@gmail.com + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + allow-empty-output: true + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$GoogleCalendarRetrieveevents ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleCalendarRetrieveevents + $ref: >- + #/node-output/Google Calendar Retrieve + events/response/payload + - variable: GoogleCalendarRetrieveeventsMetadata + $ref: '#/node-output/Google Calendar Retrieve events/response' + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Google Calendar events + assembly-2: + assembly: + execute: + - if: + name: If + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleCalendarRetrieveevents + $ref: >- + #/node-output/Google Calendar Retrieve + events/response/payload + - variable: GoogleCalendarRetrieveeventsMetadata + $ref: '#/node-output/Google Calendar Retrieve events/response' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$Foreachitem.summary}}': Amazon EC2 Event + execute: + - set-variable: + name: Set variable + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`variable`: + type: object + properties: + Attendees: + type: array + items: + type: object + properties: + Name: + type: string + Email: + type: string + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleCalendarRetrieveevents + $ref: >- + #/node-output/Google Calendar Retrieve + events/response/payload + - variable: GoogleCalendarRetrieveeventsMetadata + $ref: >- + #/node-output/Google Calendar Retrieve + events/response + - variable: flowDetails + $ref: '#/flowDetails' + mappings: + - variable: + mappings: + - Attendees: + foreach: + input: '$Foreachitem.attendees ' + iterator: AttendeesItem + mappings: + - Email: + template: '{{$AttendeesItem.email}}' + - Name: + template: '{{$AttendeesItem.displayName}}' + - for-each: + name: For each 2 + assembly: + $ref: '#/integration/assemblies/assembly-3' + source: + expression: '$Setvariable.variable.Attendees ' + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable + $ref: >- + #/block/If/node-output/Set + variable/response/payload + - variable: GoogleCalendarRetrieveevents + $ref: >- + #/node-output/Google Calendar Retrieve + events/response/payload + - variable: GoogleCalendarRetrieveeventsMetadata + $ref: >- + #/node-output/Google Calendar Retrieve + events/response + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Set variable Attendees + else: + execute: [] + output-schema: {} + assembly-3: + assembly: + execute: + - custom-action: + name: Amazon EC2 Launch instances + target: + $ref: '#/integration/action-interfaces/action-interface-2' + action: LAUNCHINSTANCES + map: + mappings: + - ImageId: + template: ami-0efc96a4e17e7b048 + - LaunchTemplateId: + template: lt-0b5d50e8377f4a886 + - MaxCount: + expression: '1' + - MinCount: + expression: '1' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreach2item + $ref: '#/block/For each 2/current-item' + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable + $ref: '#/block/If/node-output/Set variable/response/payload' + - variable: GoogleCalendarRetrieveevents + $ref: >- + #/node-output/Google Calendar Retrieve + events/response/payload + - variable: GoogleCalendarRetrieveeventsMetadata + $ref: '#/node-output/Google Calendar Retrieve events/response' + - variable: flowDetails + $ref: '#/flowDetails' + - create-action: + name: Gmail Send email + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - Body: + template: >- + Hi {{$Foreach2item.Name}}, + + + The Amazon EC2 instance with instance id + {{$AmazonEC2Launchinstances.Instance[0].InstanceId}} is + launched. + - Subject: + template: EC2 instance launched + - To: + template: '{{$Foreach2item.Email}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreach2item + $ref: '#/block/For each 2/current-item' + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: AmazonEC2Launchinstances + $ref: >- + #/block/For each 2/node-output/Amazon EC2 Launch + instances/response/payload + - variable: Setvariable + $ref: '#/block/If/node-output/Set variable/response/payload' + - variable: GoogleCalendarRetrieveevents + $ref: >- + #/node-output/Google Calendar Retrieve + events/response/payload + - variable: GoogleCalendarRetrieveeventsMetadata + $ref: '#/node-output/Google Calendar Retrieve events/response' + - variable: flowDetails + $ref: '#/flowDetails' + name: Launch an Amazon EC2 instance and send a Gmail message to the attendees of the Amazon EC2 event with instance details +models: {} diff --git a/resources/Send a Gmail message to the Zendesk user for each ticket retrieved from Zendesk.yaml b/resources/Send a Gmail message to the Zendesk user for each ticket retrieved from Zendesk.yaml new file mode 100644 index 000000000..97c4a6c06 --- /dev/null +++ b/resources/Send a Gmail message to the Zendesk user for each ticket retrieved from Zendesk.yaml @@ -0,0 +1,185 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + SCHEDULE: + input-context: + data: scheduler + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + subscription: + scheduleConfiguration: + calendar: + cronExp: 30 09 * * * + runOnceOncheck: true + timeZone: UTC + every: day + connector-type: streaming-connector-scheduler + action-interfaces: + action-interface-1: + type: api-action + business-object: Ticket + connector-type: zendeskservice + actions: + RETRIEVEALL: {} + action-interface-3: + type: api-action + business-object: mail + connector-type: gmail + actions: + CREATE: {} + action-interface-4: + type: api-action + business-object: User + connector-type: zendeskservice + actions: + RETRIEVEALL: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Zendesk Service Retrieve tickets + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + where: + status: pending + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: true + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$ZendeskServiceRetrievetickets ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: '#/node-output/Zendesk Service Retrieve tickets/response' + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Zendesk Service Ticket + assembly-2: + assembly: + execute: + - if: + name: If + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: '#/node-output/Zendesk Service Retrieve tickets/response' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$Foreachitem.ticket_fields.id__22172871394713}}': + '=': 'true' + execute: + - retrieve-action: + name: Zendesk Service Retrieve users + target: + $ref: '#/integration/action-interfaces/action-interface-4' + filter: + where: + id: '{{$Foreachitem.requester_id}}' + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: true + - create-action: + name: Gmail Send email + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - Body: + template: >- + Dear {{$ZendeskServiceRetrieveusers[0].name}}, + + Gentle reminder to update on the ticket + {{$Foreachitem.id}} which you can access here + - {{$Foreachitem.url}} to expedite the + closure. + + Thanks, + + Support Team + - Subject: + template: >- + Reminder on the Zendesk Ticket - + {{$Foreachitem.id}} - {{$Foreachitem.subject}} + - To: + template: '{{$ZendeskServiceRetrieveusers[0].email}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ZendeskServiceRetrieveusers + $ref: >- + #/block/If/node-output/Zendesk Service Retrieve + users/response/payload + - variable: ZendeskServiceRetrieveusersMetadata + $ref: >- + #/block/If/node-output/Zendesk Service Retrieve + users/response + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response + - variable: flowDetails + $ref: '#/flowDetails' + else: + execute: [] + output-schema: {} + name: Send a Gmail message to the Zendesk user for each ticket retrieved from Zendesk +models: {} diff --git a/resources/Sync new Salesforce cases with GitHub issues.yaml b/resources/Sync new Salesforce cases with GitHub issues.yaml new file mode 100644 index 000000000..d2f3da64f --- /dev/null +++ b/resources/Sync new Salesforce cases with GitHub issues.yaml @@ -0,0 +1,160 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + connector-type: salesforce + type: event-trigger + triggers: + UPDATED: + input-context: + data: Case + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: {} + action-interfaces: + action-interface-2: + type: api-action + business-object: Issue + connector-type: github + actions: + RETRIEVEALL: {} + action-interface-3: + type: api-action + business-object: Issue + connector-type: github + actions: + UPDATEALL: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: GitHub Retrieve issues + target: + $ref: '#/integration/action-interfaces/action-interface-2' + filter: + where: + and: + - labels2: Salesforce Case + - OwnerName: non-ibm-primary + - RepoName: pratiktest + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: true + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$GitHubRetrieveissues ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GitHubRetrieveissues + $ref: '#/node-output/GitHub Retrieve issues/response/payload' + - variable: GitHubRetrieveissuesMetadata + $ref: '#/node-output/GitHub Retrieve issues/response' + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: GitHub Issue + tags: + - incomplete + assembly-2: + assembly: + execute: + - if: + name: If + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GitHubRetrieveissues + $ref: '#/node-output/GitHub Retrieve issues/response/payload' + - variable: GitHubRetrieveissuesMetadata + $ref: '#/node-output/GitHub Retrieve issues/response' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$Foreachitem.title}}': '{{$Trigger.Subject}}' + execute: + - update-action: + name: GitHub Update issue 2 + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - OwnerName: + template: non-ibm-primary + - RepoName: + template: pratiktest + - body: + template: >- + CaseID: {{$Trigger.Id}}, CaseNumber: + {{$Trigger.CaseNumber}}, CaseType: + {{$Trigger.Type}}, CaseReason: + {{$Trigger.Reason}}, CaseOrigin: + {{$Trigger.Origin}}, Name: + {{$Trigger.SuppliedName}}, Email: + {{$Trigger.SuppliedEmail}}, Phone: + {{$Trigger.SuppliedPhone}}, Company: + {{$Trigger.SuppliedCompany}}, Product: + {{$Trigger.Product__c}}, Potential Liability: + {{$Trigger.PotentialLiability__c}}, + LastModifiedDate: + {{$Trigger.LastModifiedDate}} + - title: + template: '{{$Foreachitem.title}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GitHubRetrieveissues + $ref: >- + #/node-output/GitHub Retrieve + issues/response/payload + - variable: GitHubRetrieveissuesMetadata + $ref: '#/node-output/GitHub Retrieve issues/response' + - variable: flowDetails + $ref: '#/flowDetails' + filter: + where: + and: + - number: '{{$Foreachitem.id}}' + - OwnerName: non-ibm-primary + - RepoName: pratiktest + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GitHubRetrieveissues + $ref: >- + #/node-output/GitHub Retrieve + issues/response/payload + - variable: GitHubRetrieveissuesMetadata + $ref: '#/node-output/GitHub Retrieve issues/response' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 1 + allow-empty-output: true + else: + execute: [] + output-schema: {} + name: Sync new Salesforce cases with GitHub issues +models: {} diff --git "a/resources/Update a ticket to closed status in Zendesk for tickets that didn\342\200\231t have a response from the user for more than 3 days.yaml" "b/resources/Update a ticket to closed status in Zendesk for tickets that didn\342\200\231t have a response from the user for more than 3 days.yaml" new file mode 100644 index 000000000..4a3cfece8 --- /dev/null +++ "b/resources/Update a ticket to closed status in Zendesk for tickets that didn\342\200\231t have a response from the user for more than 3 days.yaml" @@ -0,0 +1,342 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + SCHEDULE: + input-context: + data: scheduler + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + subscription: + scheduleConfiguration: + calendar: + cronExp: 30 09 * * * + runOnceOncheck: true + timeZone: UTC + every: day + connector-type: streaming-connector-scheduler + action-interfaces: + action-interface-1: + type: api-action + business-object: Ticket + connector-type: zendeskservice + actions: + RETRIEVEALL: {} + action-interface-2: + type: api-action + business-object: Ticket + connector-type: zendeskservice + actions: + UPDATEALL: {} + action-interface-3: + type: api-action + business-object: message + connector-type: slack + actions: + CREATE: {} + action-interface-4: + type: api-action + business-object: message + connector-type: slack + actions: + CREATE: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: Zendesk Service Retrieve tickets + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + where: + status: pending + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: true + - for-each: + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + source: + expression: '$ZendeskServiceRetrievetickets ' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: '#/node-output/Zendesk Service Retrieve tickets/response' + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + map: + $map: http://ibm.com/appconnect/map/v1 + mappings: [] + display-name: Zendesk Service Ticket + assembly-2: + assembly: + execute: + - set-variable: + name: Set variable 3 + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`variable`: + type: object + properties: + last_updated_converted: + type: number + current_time_converted: + type: number + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: '#/node-output/Zendesk Service Retrieve tickets/response' + - variable: Setvariable + $ref: '#/node-output/Set variable/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + mappings: + - variable: + mappings: + - current_time_converted: + expression: $number($toMillis($Trigger.currentEventTime)) + - last_updated_converted: + expression: '$number($toMillis($Foreachitem.updated_at)) ' + - set-variable: + name: Set variable 2 + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`variable`: + type: object + properties: + Sum_3days_post_last_updated: + type: number + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable3 + $ref: >- + #/block/For each/node-output/Set variable + 3/response/payload + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: '#/node-output/Zendesk Service Retrieve tickets/response' + - variable: flowDetails + $ref: '#/flowDetails' + mappings: + - variable: + mappings: + - Sum_3days_post_last_updated: + expression: >- + $number(259200000+$Setvariable3.variable.last_updated_converted) + - if: + name: If + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable3 + $ref: '#/block/For each/node-output/Set variable 3/response/payload' + - variable: Setvariable2 + $ref: '#/block/For each/node-output/Set variable 2/response/payload' + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: '#/node-output/Zendesk Service Retrieve tickets/response' + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + and: + - '{{$Setvariable3.variable.current_time_converted}}': + gte: >- + {{$Setvariable2.variable.Sum_3days_post_last_updated}} + - '{{$Foreachitem.ticket_fields.id__22172871394713}}': + '=': 'true' + hashKey: object:86 + execute: + - update-action: + name: Zendesk Service Update ticket + target: + $ref: '#/integration/action-interfaces/action-interface-2' + map: + mappings: + - comment: + mappings: + - body: + template: >- + Closing the ticket as no response + received from the customer. + - status: + template: closed + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable3 + $ref: >- + #/block/For each/node-output/Set variable + 3/response/payload + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response + - variable: flowDetails + $ref: '#/flowDetails' + filter: + where: + id: '{{$Foreachitem.id}}' + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable3 + $ref: >- + #/block/For each/node-output/Set variable + 3/response/payload + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response + - variable: flowDetails + $ref: '#/flowDetails' + limit: 1 + allow-empty-output: true + - create-action: + name: Slack Send message + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - OBJECT_ID: + template: C04KMH8MALT + - OBJECT_NAME: + template: channel + - text: + template: >- + Ticket No. {{$ZendeskServiceUpdateticket.id}} + is closed as no response received from the + customer. + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: ZendeskServiceUpdateticket + $ref: >- + #/block/If/node-output/Zendesk Service Update + ticket/response/payload + - variable: ZendeskServiceUpdateticketMetadata + $ref: >- + #/block/If/node-output/Zendesk Service Update + ticket/response + - variable: Setvariable3 + $ref: >- + #/block/For each/node-output/Set variable + 3/response/payload + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response + - variable: flowDetails + $ref: '#/flowDetails' + else: + execute: + - create-action: + name: Slack Send message 2 + target: + $ref: '#/integration/action-interfaces/action-interface-4' + map: + mappings: + - OBJECT_ID: + template: C04KMH8MALT + - OBJECT_NAME: + template: channel + - text: + template: No tickets updated. + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: Trigger + $ref: '#/trigger/payload' + - variable: Setvariable3 + $ref: >- + #/block/For each/node-output/Set variable + 3/response/payload + - variable: Setvariable2 + $ref: >- + #/block/For each/node-output/Set variable + 2/response/payload + - variable: ZendeskServiceRetrievetickets + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response/payload + - variable: ZendeskServiceRetrieveticketsMetadata + $ref: >- + #/node-output/Zendesk Service Retrieve + tickets/response + - variable: flowDetails + $ref: '#/flowDetails' + output-schema: {} + name: Update a ticket to closed status in Zendesk for tickets that didn’t have a response from the user for more than 3 days +models: {}