# Legalsense
This plugin will periodically query the legalsense application API v3 for new and updated matters. A job is scheduled using the interval in minutes, start and end datetime properties. After each run the LastRunDate is updated. Only created or changed matters after that time are converted to json files and dropped in the monitor directory.
User properties are cached for 2 days. Restart the site provisioning service for a refresh.
Copy the dll files from the Plugins\Legalsense directory to the site provisioning directory.
Restart the service to activate the plugin.
Start the configurator and browse to CustomSettings to configure the Legalsense plugin.
# Configuration
To connect to the API of Legalsense Online, you need to provide the following headers:
- X-Legalsense-Api-Client-Identifier
- X-Legalsense-Api-Client-Token
To obtain a client identifier and client token to be used for the API, please contact Legalsense support at support@legalsense.nl.
These headers are used to identify your API client, and grant your API client to access our API on all Legalsense Online installations. They do not grant you access to the data inside those installations.
To get access to the data inside the installations, you also need to have access to an account on that installation, and use the Login/Logout flow.
In the plugin configurator specify the url, client identifier, client token.
Then you need to set one of the two types of authentication, Bearer_Token (preferred) or Username/Password (to be deprecated).
To get an authentication token (Bearer Token):
- Login in LegalSense website as the user that should be used for the API
- Open https://(client-environment).legalsense.nl/users/users/userprofile/ (top right, click on user, My Profile)
- In the "Authentication Tokens" panel, click on "Add Token" to generate a new token.
- Copy the generated token to the Bearer_Token field in the plugin config.
TestMapping
If enabled, move the parsed json to the test directory and don't update the lastchangedatetime
Rest Filter Query Parameters
Set REST query filter parameters for Matters endpoint. The filter modified_date__gte=LastRunDate is always set by default. Example: softkill_status=all&number=1001&created_date__gte=2020-01-01.
See LS V3 API Documentation (opens new window) for supported filters (see GET Matters).
Currently this is supported:
- number, eg. ?number=1001
- modified_date__lte, modified_date less than eg. ?modified_date__lte=2020-01-01
- modified_date__gte, modified_date greater than eg. ?modified_date__gte=2020-01-01
- created_date__lte, created_date less than eg. ?created_date__lte=2020-01-01
- created_date__gte, created_date greater than eg. ?created_date__gte=2020-01-01
- tags, eg. ?tags=lorem
- softkill_status, eg. ?softkill_status=all
- active (default)
- all
- archived
- deleted
Dynamic Values
The properties that use Dyanmic Values can be replaced with another value. You can set a dynamic value for LegalSense.{PropertyName} and the replace values. The PropertyName is the string configured for each field, for example the SharePoint column name.
# Client
DefaultClientCode Default client code used when none is specified.\
DefaultClientName
Default client name used when none is specified.
Parent Client
The parent client can be imported into the client list via the setting Parent Client Columnname.
If empty or equal to the client, an empty value will be set.
Enable the setting ClientParentClientNameUseClientIfEmpty to set the client name as value for an empty value.
Parent Client Code Columnname
Specify the name of the column in the client list for the parent client code
Can be set as Dynamic Values.
ClientIdColumnName
Sharepoint column name for the client.id field
ClientAccountManager
Sharepoint column name for the client.accountmanager field
Can be set as Dynamic Values.
Parent Client Text Columnname
Specify the name of the column in the client list for the parent text client name
Can be set as Dynamic Values.
Parent Client ID Text Columnname
Specify the name of the column in the client list for the parent text client id
Export Parent Client
if enabled export the parent client as a seperate listitem
Parent Client Fill Client If Empty
Specify if client name should be used if no parent is defined or equal to itself
# Matter
Matter Name
Json file property to match the sharepoint matter name field, for example: name; display; custom_fields.DMS_dossiernaam;
If no property is defined, or is null or empty, then it will set matter name to display. After that if it is null or empty, it will set to name.
UseMatterName, if enabled, and no file property set for matter name or it is null or empty, force the plugin to use matter name field and not the matter display field.
MatterFilter
Define one or more filters if not all matters should be created or updated in SharePoint. Use the format ls_fieldname=value;
. Check the json below for the a complete list of fields.
For example:
chinese_wall_kind=1|3
Only matters with chinese_wall_kind = 1 OR 3 are valid. Use | (pipe character) as a separator for multiple values.
matter_status.id=2
Only matters with matterstatus 2
See MatterList Filter for more samples.
UseMatterName
Indicates whether to use the Matter name property from LegalSense.
MatterIdColumnName
Sharepoint column name for the matter.id field
MatterTypeColumnName
Sharepoint column name for the matter.matter_type field
Can be set as Dynamic Values.
MatterTypeCodeColumnName
Sharepoint column name for the matter.matter_type.code field
Can be set as Dynamic Values.
MatterPracticeAreaColumnName
Sharepoint column name for the matter.practice_area field
Can be set as Dynamic Values.
MatterPracticeGroupColumnName
Sharepoint column name for the matter.practice_group field
Can be set as Dynamic Values.
MatterSupervisingUserColumnName
Sharepoint column name for the matter.supervising_user field
Can be set as Dynamic Values.
MatterBillingUserColumnName
Sharepoint column name for the matter.billing_user field
Can be set as Dynamic Values.
MatterOriginatingUserColumnName
Sharepoint column name for the matter.originating_user field
Can be set as Dynamic Values.
MatterReferrerColumnName
Sharepoint column name for the matter.referrer field
Can be set as Dynamic Values.
MatterStatus
Softkill_Status delete:
If a LegalSense matter has deleted status, the plugin will check if the matter exists in Epona365. If it exists then an email is sent for manual delete in Epona365. If it does not exist, then the matter will be skipped and the json file will not be created.
Legalsense contains two fields for the matter status:
- softkill_status, possible values are 1 = open, 2 = archived, 3 = removed
- matterstatus, lookup list in legalsense
MatterStatusFieldColumnName
Sharepoint column name for the matter_status field (instead of the softkill_status field)
Can be set as Dynamic Values.
Matter Softkill Status Columnname
Sharepoint column name for the matter softkill_status field (open, archived, removed), instead of the matter_status field
Can be set as Dynamic Values.
Matter Softkill Status Open
Specify the value that should be used when the matter is open (softkill status)
Can be set as Dynamic Values.
Example: 1
Matter Softkill Status Archived
Specify the value that should be used when the matter is archived (softkill status)
Can be set as Dynamic Values.
Example: 2
Matter Softkill Status Removed
Specify the value that should be used when the matter is removed (softkill status)
Can be set as Dynamic Values.
Example: 3
MatterIsRecofaColumnName
Sharepoint column name for the is recofa field (true/false)
Can be set as Dynamic Values.
MatterIsRecofaValueForTrue
Specify the value that should be used when is recofa is true
MatterIsRecofaValueForFalse
Specify the value that should be used when is recofa is false
MatterOpenDate
Sharepoint column name for the matter open date
MatterArchivedDate
Sharepoint column name for the matter archived date
MatterArchiveNumber
Sharepoint column name for the archive number
Can be set as Dynamic Values.
MatterRealArchiveNumber
Sharepoint column name for the real archive number
Can be set as Dynamic Values.
MatterFirmColumnName
Sharepoint column name for the firm related to the matter
Can be set as Dynamic Values.
Chinese wall kind
The field chinese wall kind contains a numeric (system defined) value in LegalSense. Ask the LegalSense support department for the possible values implemented for a specific client. Create a field mapping value to map it to a string value in SharePoint.
MatterChineseWallKindColumnName
Sharepoint column name for the Chinese wall kind for the matter
Can be set as Dynamic Values.
Example: you can set a dynamic value for LegalSense.MatterChineseWallKindColumnName (replace the name with the correct value) where value 1 converts to "Active", then when this value is 1 it will be saved as "Active".
If the final value is an Integer it will be stored as Integer, else as string.
MatterCreateDate
Sharepoint column name for the matter creation date
MatterCanArchive
Indicates if the matter can be archived
Can be set as Dynamic Values.
MatterCustomFields
Specify the customfieldmapping between LS and Sharepoint (ls customfieldname=sharepointfieldname;), Full Matter Name=MatterDescription;
Can be set as Dynamic Values.
# Sharepoint
CustomField Name
Store Sharepoint url in customField. Specify the name of the customfield in LS where the sharepoint URL will be stored.
After the matter is created/updated in Sharepoint the Doclib Url can be stored in a custom field in Legalsense. Specify the name of the custom field (type is url in Legalsense). The UI in Legalsense will show a clickable link to Sharepoint.
# JSON Examples
Possible matter fieldnames and values:
"created_date": "2013-06-26T00:00:00",
"modified_date": "2013-06-26T00:00:00",
"id": 19475,
"display_name": "Van Landschap OG B.V./advies Horeca (2013.25576)",
"url": "https://epona.legalsense.nl/api/v3/matters/19475/",
"softkill_status": 1,
"tags": [],
"access_kind": 1,
"activity_groups": [
{
"display_name": "Standaard",
"id": 1,
"url": "https://epona.legalsense.nl/api/v3/activitygroups/1/"
}
],
"archived_date": null,
"billing_instructions": null,
"billing_user": {
"display_name": "Chris Bron",
"id": 4887,
"url": "https://epona.legalsense.nl/api/v3/users/4887/"
},
"block_time_entry": false,
"block_time_entry_comments": "",
"can_archive": true,
"chinese_wall_kind": 1,
"client": {
"display_name": "Van Landschap B.V.",
"id": 8237,
"url": "https://epona.legalsense.nl/api/v3/clients/8237/"
},
"client_reference": "",
"court_reference_number": "",
"currency": {
"is_derived": true,
"internal": null,
"representation": "EUR"
},
"custom_fields": [
{
"identifier": "DMSforLegal",
"value": ""
}
],
"dac6_enabled": true,
"date": "2013-06-26",
"default_invoice_kind": null,
"description": "",
"docket_number": null,
"engagement_letter_status": {
"is_derived": true,
"internal": null,
"representation": null
},
"firm": null,
"insolvency_number": null,
"invoice_language": {
"is_derived": true,
"internal": null,
"representation": "nl-nl"
},
"is_billable": {
"is_derived": true,
"internal": null,
"representation": true
},
"is_recofa": false,
"legal_aid_number": "",
"magistrate": null,
"matter_status": {
"display_name": "Active",
"id": 1,
"url": "https://epona.legalsense.nl/api/v3/matterstatuses/1/"
},
"matter_type": {
"display_name": "Standaard uur x tarief",
"id": 2,
"url": "https://epona.legalsense.nl/api/v3/mattertypes/2/"
},
"name": "Van Landschap OG B.V./advies Horeca",
"number": "2013.25576",
"office_expenses_rate": {
"is_derived": true,
"internal": null,
"representation": "5.00"
},
"on_hold": false,
"on_hold_until": null,
"on_hold_comments": "",
"originating_user": {
"display_name": "Hans de Boer",
"id": 4887,
"url": "https://epona.legalsense.nl/api/v3/users/4887/"
},
"points": null,
"practice_area": {
"display_name": "Wonen, onroerend goed, bouwrecht",
"id": 15,
"url": "https://epona.legalsense.nl/api/v3/practiceareas/15/"
},
"practice_group": {
"display_name": "Vastgoed",
"id": 63,
"url": "https://epona.legalsense.nl/api/v3/practicegroups/63/"
},
"price_list": {
"display_name": "<PriceList 28158>",
"id": 28158,
"url": "https://epona.legalsense.nl/api/v3/pricelists/28158/"
},
"recofa_cap": null,
"recofa_inventory": null,
"recofa_court_decision_date": null,
"reduction_rate": {
"is_derived": true,
"internal": null,
"representation": "0.00"
},
"referrer": {
"is_derived": false,
"internal": {
"display_name": "Vaste relatie",
"id": 2,
"url": "https://epona.legalsense.nl/api/v3/referrers/2/"
},
"representation": {
"display_name": "Vaste relatie",
"id": 2,
"url": "https://epona.legalsense.nl/api/v3/referrers/2/"
}
},
"rvr_approval_date": null,
"supervising_user": {
"display_name": "Ed van Hart",
"id": 4887,
"url": "https://epona.legalsense.nl/api/v3/users/4887/"
},
"users": [],
"wip_percentage": "100.00"
Possible client fieldnames and values:
"created_date": "2002-05-16T00:00:00",
"modified_date": "2020-06-15T10:23:22",
"id": 8237,
"display_name": " Van der Gugten Onroerend Goed B.V.",
"url": "https://epona.legalsense.nl/api/v3/clients/8237/",
"softkill_status": 1,
"tags": [],
"alternative_names": "",
"branches": [],
"billing_instructions": "Billing instructions",
"client_status": {
"display_name": "Active",
"id": 1,
"url": "https://epona.legalsense.nl/api/v3/clientstatuses/1/"
},
"contact": {
"display_name": "Van der Gugten Onroerend Goed B.V.",
"id": 38493,
"url": "https://epona.legalsense.nl/api/v3/contacts/38493/"
},
"currency": {
"is_derived": true,
"internal": null,
"representation": "EUR"
},
"custom_fields": [],
"date": "2002-05-16",
"description": "",
"engagement_letter_status": null,
"is_billable": true,
"is_identified": false,
"name": " Van der Gugten Onroerend Goed B.V.",
"number": "13335",
"office_expenses_rate": {
"is_derived": true,
"internal": null,
"representation": "5.00"
},
"originating_user": null,
"parent_client": {
"display_name": " Van der Gugten Onroerend Goed B.V.",
"id": 8237,
"url": "https://epona.legalsense.nl/api/v3/clients/8237/"
},
"price_list": {
"display_name": "<PriceList 28159>",
"id": 28159,
"url": "https://epona.legalsense.nl/api/v3/pricelists/28159/"
},
"reduction_rate": "0.00",
"referrer": null,
"sector": {
"display_name": "Vastgoed & Projecten",
"id": 125,
"url": "https://epona.legalsense.nl/api/v3/sectors/125/"
}
For custom fields, use syntax custom_field_identifier=SP_Property
. As the matter example above: DMSforLegal=SP_Property
For reference fields like (practice_area, supervising_user, etc) specify the id "reference value", see samples above. For example: practice_area=15
(where 15 is the internal ID of the practice area).
To filter on an empty value use the magic string __EMPTY__
(double underscore), for example archived_date=__EMPTY__
.
To filter on an non empty value use the magic string __NOTEMPTY__
(double underscore), for example archived_date=__NOTEMPTY__
.