when incident priority is p5 , problem priority is also same ,but need to change.

surya65
Tera Contributor

Hi Team,

i have incident priority are: 1 to 5.

problem priority are :1 to 4.

when i  cretaed the incident with priority p5, and i created the problem through incident ,and 

priority of the problem is same has incident p5.

but in the problem form, under priority drop down i have 1 - 4, 

soo need to change when the incident  priority is p5, when problem priority should be p4. only.

in my case its showing p5. 

how can i achive this any helps,

thanks,

surya.

20 REPLIES 20

surya65
Tera Contributor

choice list of priority.

find_real_file.png

Hi Surya,

I have replicate the scenario which you have mentioned above in my PDI. I removed choice value 5 from Priority field and then created an Problem from Incident and it mapped it to a number as 5.

Reason being while copying fields on Problem table it was not able fetch any Priority 5 in selection panel and hence it mapped it to as shown below:

find_real_file.png

Solution:

You can write a Before Insert Business Rule on Problem Table and check if it has been created from Incident or not and if the priority coming from Incident is 5 or not.

Note: You need to make sure you have to set the Urgency or Impact field as well , only changing Priority in Business Rule alone will not work as those Impact and Urgency calculates the priority of the ticket.

BR Details:

Table name: Problem:

When: Before Insert

Condition: Source Incident is not empty

Source Incident is Not empty AND Source Incident.Number Starts with INC

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	if(current.priority == 5){
		current.urgency =2;
		current.priority = 4;
	}

})(current, previous);

Business Rule screenshot for reference below:

find_real_file.png

Result:

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

 

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

surya65
Tera Contributor

hi , 

has per your inputs, its taking the priority from incident form, priority is p5.and 

when i create the problem throug incident with p5 , its diplaying same priority.

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	if(current.priority == 5){
		current.urgency =2;
		current.priority = 4;
	}

})(current, previous);

im not clear on this coad.

more over im unable to set the condition you have applied,

1)source incident .

2)source incident number.

 

Okay. You need to understand how it works OOB and then only you will be able to understand what I have done in above code.

Explanation:

On Problem Form, you will see 3 fields named as "Impact, Urgency and Priority".

Priority is calculated based on value which you select in Impact and Urgency field as Priority is always read only on Problem Table.

So when you are creating a Problem from Incident, there are many attributes which gets copied from Incident to Problem and among those attributes Impact , Urgency and Priority are also there.

Now coming to your Problem:

Since you do not have Value as 5 in your Priority field on your problem form and you need to set that as 4 when a problem gets created with Priority as 5 coming from incident you need to configure the BR as per details above.

To answer your second question that you are not able to select the condition, please follow the screenshot on how to do so:

Give the first condition as Source Incident is not empty and then click on AND button as shown below:

find_real_file.png

Now type "Show related Fields" as shown below:

find_real_file.png

Then type and select Source Incident-->Incident Fields as shown below:

find_real_file.png

Now select Number as shown below:

find_real_file.png

find_real_file.png

Try the BR it will work and have tested again . It is working for me as you need.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

surya65
Tera Contributor

In condition first condition : source incident , unable to get , may i know how got that field. i tried in my personal instance but still not find .1 source Incident.