Record Producer change Priority

juliochacon23
Tera Expert

How I would like to setup a record producer to allow a user to change the priority based on their response to a question.

I created a variable in the Record Producer with Question: How urgent is your issue.   The variable is mapped to a filed in the incident table called "How Urgent"   This contains the below choices
Affecting only me

Affecting only my department

Affecting all users.

The idea is when a user selects one of the choices above the priority on the incident is changed based on their response.

I crated an assignment rule that has the response in the condition.   I think I need to put a script in the assignment rule to make this work.   Any help?screen1.PNG

Thanks

1 ACCEPTED SOLUTION

Hi Julio,



Initially my impression was that you have just created a variable on record producer and not doing any mapping on incident field.


With screenshots provided, I see that you have also created field on incident table.



Now if that is the case, you can either decide urgency or impact based on the choices since priority is driven by combination of both.



If you would have not used this mapping techniquie, then we might have done something like below in record producer script section



if(producer.'your variable name'.getDisplayValue() == 'Affecting all users')


{


    current.impact = 1;


    current.urgency = 1;


}


else if(producer.'your variable name'.getDisplayValue() == 'Affecting only me)


{



    current.impact = 1;


    current.urgency = 3;


}


View solution in original post

9 REPLIES 9

Deepak Ingale1
Mega Sage

Hello Julio,



I think you can do it by working on Producer. as well


producer is an object gets initiated with record producer.


You can go to the script section of that record producer and write your logic in there to decide the prority based on selection option at the time of submission.



http://wiki.servicenow.com/index.php?title=Record_Producer#Overview



.You can look at OOB 'Create Incident' Record producer script section to get an idea of how this can be done.



Please mark this post as correct / helpful / like according to the solution you have got.


Thanks, this helps.   I am not good with javascript any help appreciated.



-Julio


okay, no problem, I will write code for you but can you just give me those variable names?


or can you produce the same thing which you have configured in some demo instances so that I can take that forward?


Thank You


Record Producer Variable Screenshot #1.   This one is mapped to a field in the incident table screenshot #2


Let me know if you need more info.   Thank you!



Screenshot #1


screen3.JPG


Screenshot # 2


screen4.JPG