UI Action setting priority

Ag2106
Giga Contributor

setting UI action in which we need to create the button to set priority to critical and once its set then button needs to disappear

4 REPLIES 4

Anand Kumar P
Giga Patron
Giga Patron

Hi @Ag2106 ,

Create new ui action on incident table and

Condition :current.priority!= 1

Client checkbox:uncheck
Form Button:check

In server side script :

 

 

current.impact = 1;
current.urgency = 1;
current.update();
action.setRedirectURL(current);

 

 

 

Thanks,

Anand

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Ag2106 ,

 

Assuming you want to create a UI action on Incident table you can refer below.

 

DanishBhairag2_0-1696166748909.png

DanishBhairag2_1-1696166818955.png

 

Please mark my answer helpful & accepted if it helps you resolve your query.

 

Thanks,

Danish

SN_Learn
Kilo Patron
Kilo Patron

Hi @Ag2106 ,

 

In order to achieve this you can create a UI action on the incident table as below:

Active: True

show insert : True

show update : True

condition: current.priority != 1

script : 

//Setting Impact & urgency to 1 as per the Priority lookup Rules so that Urgency =  [1-High]

current.impact = 1;
current.urgency = 1;
current.update();
current.setRedirectURL(current);

 

Setting Impact & urgency to 1 as per the Priority lookup Rules as below:
 
SN_Learn_2-1696169435017.png

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Riya Verma
Kilo Sage
Kilo Sage

Hi @Ag2106 ,

 

Hope you are doing great.

 

  • Navigate to System Definition > UI Actions.
  • Click on New to create a new UI Action.
  • Provide a name for the action, e.g., "Set Priority to Critical."
  • Choose the table where you want this action to be available, e.g., "Incident" for managing IT assets.
  • Set the Action name to something like "setPriorityToCritical."
  • In the Script field, add the code to set the priority to critical and hide the button.

 

// Update the priority to critical
current.priority = 1; // 1 corresponds to Critical priority

// Hide the button after setting the priority
this.setVisible(false);
 
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma