Create a Link in RITM ( Only for Close Incomplete State) Showing the relevant Incident Number

Ankita9793
Tera Contributor

Hi All,

 

Can someone please help me with the requirement to "Create a Link in RITM ( Only for Close Incomplete State) Showing the relevant Incident Number Created for this Request. Add a log (under the "Activity" section) to the work notes of the RITM stating that "INC…… has been created from this RITM" 


Thanks in advance!!

1 REPLY 1

SarthakGoel
Tera Expert

Hi @Ankita

 

Please refer to the below code to paste the link in the work notes. Also, make sure we need to modify the filter so that you can fetch the actual incident created from your incomplete RITM.

 

Please write this as an on-before business rule on the RITM table or you can write this in the same script where you are creating the incident.

 

 

var url = '';
var gr = new GlideRecord('incident');
gr.addQuery('parent',<RITM sys_id>); // or you can add whatever identifier you are using for connecting RITM to incident
gr.query();
while(gr.next()){
url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') +gr.getTableName() + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + 'Incident created' + '</a>[/code]';
}
current.work_notes= url;

 

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response helpful.

 

Thanks

Sarthak