RITM approval date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:31 AM
Hi,
Need to get the RITM approval date value for a request. The RITM's approval date is not updated in 'Approval set' field.
Any other field where the RITM approval date is saved ?
Please suggest.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:43 AM - edited 10-27-2023 01:48 AM
Hi @Sristi ,
The approval date for a Requested Item (RITM) is stored in the sysapproval_approver table, particularly within the sysapproval field. This table is responsible for tracking approval records and recording their respective approval dates.
Run below script with ritm sys_id in background script in lower instance then you will get the date of approved.
var ritmSysID = 'd03318cd2ff1311056a7c786f699b631';
var approvalGr = new GlideRecord('sysapproval_approver');
approvalGr.addQuery('sysapproval', ritmSysID);
approvalGr.addQuery('state', 'approved');
approvalGr.query();
if (approvalGr.next()) {
var approvalDate = approvalGr.sys_updated_on.getDisplayValue();
gs.info('Approval Date for RITM: ' + approvalDate);
} else {
gs.info('No approval date found for the RITM.');
}
Please mark it as solution proposed and helpful if it works for you.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:50 AM - edited 10-27-2023 01:52 AM
@Sristi there is another field on sc_req_item called 'approval', this field value is 'requested' for me even if RITM is approved hence 'approval set' is not getting populated, not sure if this is OOTB issue, but if you add a logic to update value to 'approved' once RITM is approved then approval set will be autopopulated with timestamp at which you update it and you can use it for further processing.
Best regards
Suyog