CASE

From RuLa, you can access certain information about the case itself. For this, within applicable rules, you have access to the constant CASE like to any other instance. On this instance, the following information is available:

Property

Description

CASE.case_number

The case number in the user readable format, e.g. CSE-1991.

CASE.process_key

The key of the process the case is based on, e.g. end_to_end_onboarding.

CASE.process_name

The translated name of the process the case is based on, e.g. End to End Onboarding. Note: This will be translated on documents and in the case manager. Within rules, it's just a placeholder, so e.g. `CASE.process_name = 'Onboarding'` will not work. Use process_key for such comparisons.

CASE.outcome_instance

The outcome instance this case operates on. For a case creating a new contract this is often ContractualRelationship.

CASE.state

The key of the current state the case is in, e.g. draft.

CASE.all_states

All possible states the case could be in according to the workflow of the process.

CASE.states_history

Returns a dictionary with some statistical information about each state. This includes:

  • initiator (the last one)

  • entered (when was this state entered last)

  • days (Total days in state, so the time in days the case was in this state every time it entered)

  • times_entered (how many times the case entered this state)

  • previous_state (the last one)

CASE.last_transition

The key of the last transition (if any) that was done to arrive at the current state, e.g. back_to_draft.

CASE.last_transition_at

The time when the last transition (if any) happened, e.g. 2022-11-17 11:05:30.322951

CASE.last_transition_by

The username of the user that performed the last transition

CASE.last_transition_by_name

The name of the user that performed the last transition

CASE.number_of_missing_information

How many information still should be provided (the sum of all the grey bubbles on information tabs).

CASE.number_of_tasks

Current number of tasks within the case.

CASE.number_of_issues

Current number of issues within the case.

CASE.created_at

The time when the case was created, e.g. 2021-11-30 16:40:12.923654

CASE.last_update

The last time the case was updates, e.g. 2021-03-12 11:58:08.644664.

CASE.owner

The owner of the case (the email in rules and the full name and email when printed)

CASE.owner_name

The full name of the case owner

CASE.owner_groups

A list of the names of the groups the current case owner has.

CASE.owner_roles

A list of the names of the roles the current case owner has.

CASE.initiator

The initiator of the case (the email in rules and the full name and email when printed)

CASE.initiator_name

The full name of the case initiator

CASE.assignee

The assignee to the case (the email in rules and the full name and email when printed)

CASE.assignee_name

The full name of the case owner

CASE.approver

The user (if any) who approved the case (the email in rules and the full name and email when printed)

CASE.approver_name

The full name of the case approver

CASE.documents

A list with the names of all documents that are used in a case. This can be used to e.g. create a customised table of contents.

CASE.proofs

A list with the names of all proofs that are used in a case. This can be used to e.g. create a customised table of contents.

CASE.comments

A list of dictionaries about all the comments in a case. Each dictionaries contains these keys:

  • creation_date - ISO 8601 timestamp when the comment was created (string or null)

  • edit_date - ISO 8601 timestamp when the comment was last edited (string or null)

  • author - Name of the user who created the comment (string or null)

  • assignee - Name of the user assigned to the comment/task (string or null)

  • text - The comment text content (string or null)

  • is_issue - Whether the comment is marked as an issue (boolean)

  • is_resolved - Whether the issue has been resolved (boolean)

  • resolved_by - Name of the user who resolved the issue (string or null)

  • is_archived - Whether the comment is archived (boolean)

  • archived_by - Name of the user who archived the comment (string or null)

  • deadline - ISO 8601 timestamp for the task deadline (string or null)

  • referenced_instance - ID of the instance the comment refers to (integer or null)

  • referenced_information_key - Key of the information field the comment refers to (string or null)

  • referenced_readable - Human-readable reference, e.g., "Person 66" or "John Doe / street_and_number" (string or null)

  • is_warning - Whether the comment is a warning (boolean)

  • title - Title of the comment, if from a rule with a title translation (string, optional)

  • replies - List of reply comment dictionaries with the same structure (array, only present if comment has replies)

Example: CASE.number_of_issues

This rule will only be fulfilled when there are no issues or tasks within a case.

Example: CASE.state

This rule would only be fulfilled while the case is in the state with the key '"draft".

Please note that if you are using this to create an issue or comment, it would be, as any other issue, comment or warning, removed when the case leaves that state (unless a user replied to it or was assigned to it).

Last updated

Was this helpful?