I need to set the Priority of Tasks which would be same as RITM priority

rajojunaresh
Tera Contributor

When a catalog item is raised, based on some criteria, the priority of RITM gets changed. Now the Tasks are getting generated with default p4. I need to set te Priority of these Tasks to be same as RITM Priority.

 

This is code which i tried using BR.

 function onBefore(current, previous) {
  var gr = new GlideRecord('sc_task');
    gr.addActiveQuery();
    gr.addQuery('request_item',current.sys_id);
    gr.query();
    if(gr.next()){
    gr.priority= 3;
    gr.update();
    }
 

5 REPLIES 5

rajojunaresh
Tera Contributor

Am unable to add the code in the create task.... it is a choice, we don't have condition field over to put it....