How to create cancel button in RITM form in ITIL view and also How to create cancel button in RITM form in Service Portal and that condition to be met is when approval will approve the RITM then cancel button should not be there.

Sravani Gorle
Kilo Contributor
can anyone explain it in detailed way
1 ACCEPTED SOLUTION

Hi,

here you are not setting the approval value properly

jr.setValue('approval', 'requested');

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

16 REPLIES 16

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

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

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.

 

 

Supriya37
Kilo Contributor

Hi Ankur,

        I have already mentioned in the question to create cancel button in Service Portal can you please check it..

Regards,

Sravani

 

Sravani Gorle
Kilo Contributor

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