- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 12:28 PM - edited 07-29-2025 12:31 PM
Hi All,
I got a requirement,
For SCTASK: Whenever the requested for responds to the requests, the state has to automatically move from Pending to Work In Progress(This is Done).
For Sequential SCTASK: If the state is pending, then the RITM should be in Pending and the Pending Reason should copy from SCTASK to RITM(This is Done)
For Parallel SCTASK: If any one of the SCTASK is in Pending , then the RITM should be in Pending and the Pending Reason should copy from SCTASK to RITM(This is Done)
All the comments should be copied from RITM to SCTASK and vice-versa. ( When comments are added on RITM by Requested for or Ticket Worker comments are getting duplicated on RITM and activities also shown duplicates i.e., State changes activity, but comments from RITM to SCTASK copying only once which is expected behavior.)
When 'Requested for' comments on RITM on front end the state is changing and comments are going to SCTASK but if 'Requested for' only adds additional comments comment's are not copying to SCTASK)
All SCTASK comments should be copied to RITM only when SCTask's are in active states.
I have written below business rules on RITM and sc_task please help me with your inputs to achive the required functionality.
Business rule on RITM:
Script Section :
Script on sc_task table:
Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 12:24 AM
it's setting with hard-coded state value then it should work fine,
use this to fetch the comments
Did you print state value in logs?
sctask.comments = current.comments.getJournalEntry(1);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 01:15 PM
It appears that your scripts might be conflicting with the out-of-the-box (OOB) scripts. I recommend reviewing the existing Business Rules on the following tables: sc_req_item, sc_request, sc_task, and task.
To pinpoint the conflicting Business Rule, use the "Actions" tab to add an info message. During testing, this message will surface at the top of the screen, clearly indicating which rule is executing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 07:11 PM
Hi @Laveena-Agarwal ,
When we update the RITM the logs which we have given in the SCTASK business rules are showing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 08:27 PM
so what debugging did you do?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 09:57 PM - edited 07-29-2025 10:09 PM
Hi @Ankur Bawiskar / @Laveena-Agarwal ,
As mentioned above I have done debug by providing string text logs on sc_task table it's showing the messages (using addinfomessage i tested).
I have checked OOB business rules on sc_req_item and sc_task also, but I don't see any BR which is causing the issue .
Thanks,