Providing link to a variable value in notification

mdsannavulla
Kilo Guru

Hi All,

Is it possible to providing a link to a variable value in notification if the variable is reference to some table

Script I have written in notification ITCC # : ${current.variable_pool.ITCC_no}

Output ITCC # : CHG0004892 -------- here I wants link to that change number


Any help is appreciated ....

13 REPLIES 13

Add the original link which I had provided at the end of the <mail_script> tag



<a href="nav_to.do?uri=change_request.do?sys_id=${current.variable_pool.ITCC_no.sys_id}">${current.variable_pool.ITCC_no}</a>


Its working and thank you for your help...



How to achieve this requirement in approval notification which will be sent from sysapproval_approver table............


You can use the same logic over there as well with GlideRecord Operation in mail script tag. You can find the RITM number as GlideRecord and then you can dot walk to it to fetch the variable.


Kindly mark this post as correct / helpful if it solved you problem.


Could please explain me how to do this. I tried like below but it is not working



<mail_script>


  template.print("Summary of Requested items:\n");  


  var item = new GlideRecord("sc_req_item");


  item.addQuery("sys_id", current.sysapproval);


  item.query();


while(item.next()) {


          template.print("       Options:\n");


          var keys = new Array();


          var set = new GlideappVariablePoolQuestionSet();


          set.setRequestID(item.sys_id);


          set.load();


          var vs = set.getFlatQuestions();


          for (var i=0; i < vs.size(); i++) {


     


if(vs.get(i).getLabel() ==   'ITCC #')


{


                    template.space(4);


                    template.print('         ' +   vs.get(i).getLabel() + " = " + <a href="nav_to.do?uri=change_request.do?sys_id=vs.get(i).getValue() ">vs.get(i).getDisplayValue() </a> +   "\n");  


}


               


            }


          }


}



</mail_script>


By keeping aside my previous suggestion of doing gliderecord operation, can you just add below tag without doing any Glide Record operation.


I guess that should also work.



<a href="nav_to.do?uri=change_request.do?sys_id=${sysapproval.sys_id}">${sysapproval}</a>