Script to capture priority input from record producer and show in incident table

FaizDev101
Tera Expert

Screenshot (99).png

3 ACCEPTED SOLUTIONS

@FaizDev101 try this

 

if(producer.priority == '1 - Critical'){//priority variable choices  1 - Critical "value"

current.impact =1;

current.urgency = 1;

}else if(producer.priority == '2 - High'){/priority variable choices  2 - High "value"

current.impact = 1;

current.urgency = 2;

}else if(producer.priority == '3 - Moderate'){/priority variable choices  3 - Moderate "value"

current.impact = 2;

current.urgency = 2;

}else if(producer.priority == '4 - Low'){/priority variable choices  4 - Low "value"

current.impact = 2;

current.urgency = 3;

}else if(producer.priority == '5 - Planning'){/priority variable choices  5 - Planning "value"

current.impact = 3;

current.urgency = 3;

}

 

check one thing in priority variable choices  "value" should be given above in "if" and "else if"

BharathChintala_0-1676405605545.png

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

View solution in original post

FaizDev101
Tera Expert

I used this code and it is working Thank you so much.

if(producer.priority == 1){

current.impact = 1;

current.urgency = 1;

}else if(producer.priority == 2){

current.impact = 1;

current.urgency = 2;

}else if(producer.priority == 3){

current.impact = 1;

current.urgency = 3;

}else if(producer.priority == 2){

current.impact = 2;

current.urgency = 1;

}else if(producer.priority == 3){

current.impact = 2;

current.urgency = 2;

}else if(producer.priority == 4){

current.impact = 2;

current.urgency = 3;

}else if(producer.priority == 3){

current.impact = 3;

current.urgency = 1;

}else if(producer.priority == 4){

current.impact = 3;

current.urgency = 2;

}else if(producer.priority == 5){

current.impact = 3;

current.urgency = 3;

}

View solution in original post

@FaizDev101  you don't need to each number that many times each priority number once is enough

Replace this

if(producer.priority == 1){

current.impact = 1;

current.urgency = 1;

}else if(producer.priority == 2){

current.impact = 1;

current.urgency = 2;

}else if(producer.priority == 3){

current.impact = 2;

current.urgency = 2;

}else if(producer.priority == 4){

current.impact = 2;

current.urgency = 3;

}else if(producer.priority == 5){

current.impact = 3;

current.urgency = 3;

}

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

View solution in original post

7 REPLIES 7

BharathChintala
Mega Sage

@FaizDev101 I  hope you know Priority will be set based on urgency and impact. If you want to update priority direct open priority variable in record producer and select map to field select priority in drop down.

 

This will map priority to incident table from record producer.

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

I tried map to field option but it's not changing, the priority remains default in incident table.

@FaizDev101 

then as I said based on impact and urgency only you can set it

 

write this in record producer script and remove map to field

if(producer.priority == '1 - Critical'){

current.impact = '1 - high';

current.urgency = '1 - high';

}else if(producer.priority == '2 - High'){

current.impact = '1 - high';

current.urgency = '2 - medium';

}

BharathChintala_0-1676396035905.png

As follows per the screen shot look up rule complete else if conditions for all 5 priorities.

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

Screenshot (104).png

   

Screenshot (105).png

Screenshot (103).png

 

added the script, removed map to field as you said still didn't changed. Please help