Passing comments From Task to RITM & RITM to Task

subashds6515
Tera Contributor

Hi All,

 

I have two business rules set up - one for passing comments from a Requested Item (RITM) to a Task, and another for passing comments from a Task to an RITM. 

Two Business rules are active only. Both are the same Condition: current.comment.changes()

1. RITM to Task

if I enter a comment in RITM it will display in the task comment.

2. Task to RITM

if I enter a comment in the task it will display in the RITM comment.

 

Two business rules are triggering at the same time. So that same comment is passing from RITM to task and also from Task to RITM.

 

  • if a comment from RITM to a Task it should not trigger a business rule(Task to RITM).
  • if a comment from Task to a RITM it should not trigger a business rule(RITM to Task).

What is the solution to prevent the repeating comments?

 

Task comment section:

subashds6515_1-1706299066516.png

RITM comment section:

subashds6515_3-1706299154235.png

 

 

 

Thanks,

Subash

8 REPLIES 8

Danish Bhairag2
Tera Sage
Tera Sage

Hi @subashds6515 ,

 

To prevent the repeating comments issue, you can add a condition in each Business Rule to check the source of the comment before triggering the actions. For example, you can check the table name where the comment is being added.

 

Here's an example:

 

### Business Rule 1: RITM to Task

- **Table**: Task

- **Condition**: `current.comment.changes() && current.table_name == 'sc_req_item'`

 

### Business Rule 2: Task to RITM

- **Table**: sc_req_item

- **Condition**: `current.comment.changes() && current.table_name == 'task'`

 

In this way, each Business Rule will only execute when a comment is added, and it checks if the comment is from the relevant table (RITM or Task). This ensures that if a comment is added from RITM, it won't trigger the Task to RITM Business Rule and vice versa.

 

Adjust the conditions based on your specific field names and table relationships, if needed. This approach should help prevent the repeating comments issue.

 

Thanks,

Danish

 

Hi @Danish Bhairag2 , 

 

Still, the comment repeats for me.

 

Task to RITM Business rule.

subashds6515_0-1706448823905.png

RITM to Task Business rule.

subashds6515_1-1706448912847.png

Is there anything in the script that I'm missing?

Thanks,

S

Hi @subashds6515 ,

 

Can u also paste the snip of the condition of the business rule. No problem in script but the trigger conditions we need to be careful about.

 

Thanks,

Danish

 

Hi @Danish Bhairag2 ,

subashds6515_1-1706598513923.png

 

subashds6515_2-1706598563039.png

 

Thanks,

s