- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 02:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 05:32 AM
Hi,
here you are not setting the approval value properly
jr.setValue('approval', 'requested');
Regards
Ankur
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-27-2020 06:29 AM
Hi,
Thanks for your reply, the error is not coming now, but at the backend the RITM state is not changing to closed incomplete..
SERVER SCRIPT TO CHANGE THE STATUS,
//input
if (input && input.action == 'Cancel') {
// If Requested item
if (data.table == 'sc_req_item') {
var jr = new GlideRecord('sc_req_item');
jr.get(data.sys_id);
jr.setValue('approval', 'requested');
jr.setValue('state', '4');
jr.update();
}
}
})();
Regards,
Sravani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 07:50 AM
Hi Sravani,
Are you getting the sys_id of RITM here?
can you try this updated script.
var sysId = data.sys_id;
gs.info(sysId);
var jr = new GlideRecord('sc_req_item');
jr.addQuery('sys_id',data.sys_id);
jr.query();
if(jr.next()){
gs.info('Inside RITM found');
jr.setValue('approval', 'requested');
jr.setValue('state', '4');
jr.update();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2021 10:14 PM
Hi
Please have a look at the below question
https://community.servicenow.com/community?id=community_question&sys_id=3729f477dba2ecd011762183ca96198b
can u please let me know if u have any solution on this..
Thanks in Advance,
Shilpa.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 04:32 AM
Hi Ankur,
I have already mentioned in the question to create cancel button in Service Portal can you please check it..
Regards,
Sravani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 04:40 AM
Hi Ankur,
I have already mentioned in the question that create cancel button in service portal in RITM form can you please check it...
Regards,
Sravani