How to set priority based on Impact & Urgency in a custom table?

Alok21
Giga Expert

Hi,

As we all know Priority is a field in Task table. When we create a custom table and extend it from Task table, priority field also get mapped to custom table.

My requirement here is, how do i set priority automatically based on Impact and urgency fields.

Can someone plz assist here?

Regards,

Alok

1 ACCEPTED SOLUTION

Jaydeep Parmar
Kilo Guru

Hi Alok,

create one new Data lookup for your custom table.

under System Policy--> Rules-->Data Lookup Definition

Data lookup rule.

In Source table : Select your custom table

In target table :Select priority data lookup

And Save

refer screen for exa:find_real_file.png

find_real_file.png

Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.

Jaydeep Parmar

find_real_file.png

 

View solution in original post

7 REPLIES 7

Jaydeep Parmar
Kilo Guru

Hi Alok,

create one new Data lookup for your custom table.

under System Policy--> Rules-->Data Lookup Definition

Data lookup rule.

In Source table : Select your custom table

In target table :Select priority data lookup

And Save

refer screen for exa:find_real_file.png

find_real_file.png

Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.

Jaydeep Parmar

find_real_file.png

 

Thank you Jaydeep 🙂

Raj68
Mega Guru

Hi Alok,

please try with below code:

 

‘calculatePriority’ Business rule

Name: calculatePriority
Table: Global
Script:

 

function calculatePriority(impact,urgency) {
   var pVal = '4';
   //Query the priority lookup table to find the priority based on impact and urgency
   var rec = new GlideRecord('u_priority_lookup');
   rec.addQuery('u_impact', impact);
   rec.addQuery('u_urgency', urgency);
   rec.query();
   while(rec.next()){
      pVal = rec.u_priority;
   }
   return pVal;
}
 
                                       OR
 
 You can achieve this also without coding for that you have to follow the steps explained above by jaydeep.

NOTE: Mark correct or helpful if it helps you.

 

Warm Regards,

Raj patel

Thank you Raj 🙂