- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 10:32 AM - edited ‎08-09-2023 10:35 AM
Hello,
Sourcing tasks do not have the RITM already prefilled. Because of this we, need to open the REQ and see what the RITM number is, copy it, go back to the task and paste it just to source an item. Attached screenshot
Note: The task is to created based on Request table workflow not RITM Workflow. so RITM number is not auto populated.
Can anyone suggest me the script to autopopulate the RITM Number in Task record
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 12:21 PM
Ok .
Create after insert BR on sc_task and add following script in it:
var getRITM = new GlideRecord('sc_req_item');
getRITM.addQuery('request',current.request);
getRITM.query();
if(getRITM.next()){
current.request_item = getRITM.sys_id;
current.update();
}
and then test !
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 11:16 AM - edited ‎08-09-2023 11:18 AM
ok then what do you have in parent field of sc_task ? is it RITM or REQ?
On a side note: why cant you handle approval and task creation (post approval) in the same workflow which you have on RITM?
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 11:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 11:51 AM
is the sc_task in question (the one which needs the ritm number populated, but isn't) the task which is created in the workflow you attached there? ("Task for transfer allocation")...or is a different task? perhaps one that was created via previous workflow before this ritm workflow runs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 11:58 AM
There is a parent field also on task table.
Open any such task where RITM is missing. Right click header and click on Show XML, then locate the parent field and tell me what does the parent field has as value RITM or REQ?
Based on your answer I will give you a script to run in business rule.
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 12:16 PM
Parent field is REQUEST