Passing comments From Task to RITM & RITM to Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 11:59 AM
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:
RITM comment section:
Thanks,
Subash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 12:54 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2024 05:40 AM
Hi @Danish Bhairag2 ,
Still, the comment repeats for me.
Task to RITM Business rule.
RITM to Task Business rule.
Is there anything in the script that I'm missing?
Thanks,
S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2024 09:34 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 11:09 PM