- 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 10:13 PM
BR on sc_req_item should be after update and not before
Also setWorkflow(false) line should be before update() and not after that
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 10:42 PM
I have made the above changes, now additional comments are showing only once on ritm but the state on ritm is not setting to Work In progress(2) and sc_task also not updating with comments and state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 11:02 PM
Glad to know that the duplicate issue is gone based on my comment.
since you mad the BR as after update you will have to use current.update() to set the state.
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 11:18 PM
I have updated RITM business rule script as below,
Now RITM state also updating to WIP when requester comments on ritm but it's not updating sctask even though we are getting sctask.number in the info message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 11:27 PM
are the state choice values same in both sc_task and RITM?
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