*** title: Salesforce ServiceCloud Ticketing Integration Overview position: 4 excerpt: '' deprecated: false hidden: false metadata: title: '' description: '' robots: index next: description: '' --------------- # File Cases ![](https://files.readme.io/a794321-fileCase.png) ### Behind the scenes Whenever a user requires help with Case Creation, Moveworks will create a case in ServiceCloud on behalf of the user. Fields populated on `Case Creation`. #### Case Object Details
Field Definition Value Field populated by Moveworks or Customer Comments Restrictions
ContactId 15 Char Id of the SF user filing the case 15 char unique userID Moveworks 15 Char ID of SF employee who is filing the ticket. Fetch the ID from OKTA. Okta Field name = Supportforce Contact ID OR use ServiceCloud user object to get the ID and store it within Moveworks\ we will store user object details and use the ID. Object = Contact\ Field = Id, Name
Subject Title of the case "User Utterance" Moveworks Short Description of the ticket length: 255
Description Long description of the case "User Utterance" Moveworks Description of the ticket length: 32000
Origin Moveworks system used to file the ticket TBD Moveworks Name of the system which filed the ticket. Ex : moveworks / Moveworks Slack/Moveworks Web
Priority The Priority of the new case 3-Standard Moveworks Default priority is "3-Standard"
Status Status of the created case New Moveworks All new filed ticket has a status=New
OwnerId Assignment group/ queue for the the newly filed case Salesforce to use ContactId and trigger a logic to populate OwnerID Customer The owner is the ticket assignment group. for a new ticket, the owner is in a queue and then once an agent picks up the ticket, the owner changes to the individual agent id/nameLogic to select Owner Queue : It depends on location of the user who is filing the ticket. Ex : Location = Amer Then Owner = TF AMER , Location = Europe then Owner = TF EMEA
RecordTypeId * Default value = Ticket Record Moveworks Default value = Ticket Record Type
Type Identifies an Incident Case type vs. Request Case type 1. Incident 2. SERVICE REQUEST Moveworks Moveworks will Triage and accordingly set the value
API used for case creation: ``` curl --location --request POST 'https://{{base_url}}/services/data/v54.0/sobjects/Case' \ --header 'Authorization: Bearer {{auth_token}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "ContactId":"0037g00000q8KcVAAU", "Origin": "Moveworks", "Subject": "I am having issues with my VPN", "Description":"for some reasons my VPN stopped working", "Priority":"3-Standard", "Status":"New", "RecordTypeId":"0120000000000BSAAY", "Internal_Support_Category__c":"Concierge Uncategorized" }' ``` # Uploading Attachments ![](https://files.readme.io/629d637-useCase.png) End user are able to `add attachments` while: 1. Creating a new case 2. Updating an existing case API used for updating a case: ``` curl --location --request PATCH 'https://{{base_url}}/services/data/v54.0/sobjects/Case/{{case_id}}' \ --header 'Authorization: Bearer {{auth_token}} ' \ --header 'Content-Type: application/json' \ --data-raw '{ "Description": "for some reasons my VPN stopped working" }' ``` API used for adding attachments: ``` curl --location --request POST 'https://{{base_url}}/services/data/v54.0/sobjects/Attachment?Body' \ --header 'Authorization: Bearer {{auth_token}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "ParentId":"{{case_id}}", "Name":"Pls find attachment", "Body": "I wanted to share more information with the team. It may help in faster resolution" }' ``` Name of the attachment will be auto generated. ### Limitations 1. Size: we will put a limit of 32MB attachment upload. This is configurable as per customer requirement. 2. Format: No format check at Moveworks end. If the API response is an error then accordingly we will notify the end user 3. Number of attachments per ticket: No restrictions. we will allow multiple attachments per case. This is configurable. # Case Updates ## Users adding a public comment ![](https://files.readme.io/70e30c1-caseUpdate.png) API used for adding public comments: ``` curl --location --request POST 'https://{{base_url}}/services/data/v54.0/sobjects/CaseComment' \ --header 'Authorization: Bearer {{auth_url}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "ParentId": "{{case_id}}", "IsPublished": true, "CommentBody": "Need the issue resolved to be resolved this week. we have customer webinar next week", "IsNotificationSelected": true }' ``` ## Check Status ### Checking status using a specific case number ![](https://files.readme.io/fd96e9c-Screenshot_2022-08-23_at_11.27.47_AM.png) API used for case status for a case number: ``` curl --location --request GET 'https://{{base_url}}/services/data/v54.0/query/?q=SELECT+Status,Subject+from+Case WHERE CaseNumber='\''{{case_id}}'\''' \ --header 'Authorization: Bearer {{auth_token}}' ``` ### Checking status of all open cases ![](https://files.readme.io/5d5a359-Screenshot_2022-08-23_at_11.26.19_AM.png) API for checking status of all open cases: ``` curl --location --request GET 'https://{{base_url}}/services/data/v54.0/query/?q=SELECT+CaseNumber+from+Case WHERE ContactId='\''{{contact_id}}'\''' \ --header 'Authorization: Bearer {{auth_token}}' ``` ### Checking status using a keyword ![](https://files.readme.io/949e45c-Untitled_3_2.png) We will use our natural language understanding (NLU) engine to get the relevant tickets and show the status. On all case status enquiries , assignee name is shown along with the latest status. We will use “Case\_Owner\_\_c” field from Case object to extract assignee name and show it to the user. ## Case closed by a user ![](https://files.readme.io/9fbf75a-Untitled_1_5.png) API used for closing a case: ``` curl --location --request PATCH 'https://{{base_url}}/services/data/v54.0/sobjects/Case/5007g00000BPKcyAAH' \ --header 'Authorization: Bearer {{auth_token}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "Status": "Closed - By User" }' ``` ## Case reopened by the user ![](https://files.readme.io/0d6bb9c-Screenshot_2022-08-23_at_11.31.18_AM.png) API used for Reopening a case: ``` curl --location --request PATCH 'https://{{base_url}}/services/data/v54.0/sobjects/Case/5007g00000BPKcyAAH' \ --header 'Authorization: Bearer {{auth_token}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "Status": "Reopened" }' ``` **Important note for case closure/Re-open**: Case Facet object type within ServiceCloud host the logic of status transition and limitations on ticket types and user action relation. *Ex: For certain ticket types, users are not allowed to close the ticket.* Moveworks will rely on Customer to apply this logic at the data layer. Moveworks will allow users to take action all action on all tickets. If an API response is an error based on the logic, then we will inform the user accordingly. ### API error message in response ![](https://files.readme.io/17ad962-Screenshot_2022-08-18_at_2.18.57_PM.png) # Case Notifications ## Case status is moved to = Waiting for user response, Waiting for customer response Moveworks will notify the user on the status change and request that they add relevant information using “add comment” call to action. ![](https://files.readme.io/0bf8e00-Screenshot_2022-08-18_at_2.14.59_PM.png) We will also add a work note so that the Agent can see the notifications being delivered to the end user API used to add worknote: ``` curl --location --request POST 'https://{{base_url}}/services/data/v54.0/sobjects/CaseComment' \ --header 'Authorization: Bearer {{auth_token}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "ParentId": "{{case_id}}", "IsPublished": false, "CommentBody": "Adding a Private Comment", "IsNotificationSelected": false }' ``` ## Agent adds a public comment Moveworks polls all the tickets and associated comments. For all new public added comments by Agents, Moveworks will notify the user. ![](https://files.readme.io/4e0e3dd-agentComment.png) API used to fetch comments: ``` curl --location --request GET 'https://{{base_url}}/services/data/v54.0/query/?q=SELECT+CommentBody+from+CaseComment WHERE ParentId='\''{{case_id}}'\''' \ --header 'Authorization: Bearer {{auth_token}}' ``` ## No activity on case by user from past number of days ago The number of days are configurable here: ![](https://files.readme.io/52399f0-Untitled_2_3.png) Moveworks will also add a work note on the case. ## When user submits a case from a non-Moveworks channel Moveworks will notify the user and also add a work note on the case. ## Case closed by an Agent User will be notified by the bot. Moveworks will also add a worknote. ![](https://files.readme.io/d51e04f-Screenshot_2022-08-23_at_11.39.03_AM.png) API details to fetch all cases closed by an agent: ``` curl --location --request GET 'https://{{base_url}}/services/data/v54.0/query/?q=SELECT+Subject+from+Case' \ --header 'Authorization: Bearer {{auth_token}}' ```