The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Problem task priority should auto populate from problem while creating a new problem task

AnkitC_77
Tera Contributor

Problem task priority should auto populate from problem while creating a new problem task.

3 REPLIES 3

Sujatha V M
Kilo Patron
Kilo Patron

@AnkitC_77 Please refer the below link : 

 

https://www.servicenow.com/community/developer-forum/priotiy-in-the-problem-task-should-always-inher...

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Nani18
Tera Contributor

Hello @AnkitC_77 

 

1. Navigate to System Definition > Client Scripts in ServiceNow.

2. Click on New to create a new client script.

3. Fill in the fields: - Name: Give a name to your client script. - Table: Select the Problem Task table (problem_task). - Type: Select OnLoad.

4. In the Script field, write the following script: 

function onLoad() {

//Get the problem associated with this task

var problemGr = new GlideRecord('problem');

if (problemGr.get(g_form.getValue('problem'))) {

//Set the priority of the task same as the problem

g_form.setValue('priority', problemGr.getValue('priority'));

}

}

5. Click on Submit to save the client script.

 

 

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

 

Thanks

Nani

AnkitC_77
Tera Contributor

Also, the priority only needs to be auto-populated once when the new task is raised. Later both problem and problem tasks can have different priorities.