General Forums SDU Forums
SDU
![]() ![]() |
Jul 7 2008, 05:20 AM
Post
#1
|
|
|
Administrator ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Root Admin Posts: 955 Joined: 6-January 08 Member No.: 1 |
|
|
|
|
Jul 7 2008, 08:58 AM
Post
#2
|
|
![]() Level 5 Contributor ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 107 Joined: 19-February 08 Member No.: 140 |
Here is what I use for several customers. It is based on 4 levels of priority where the following matrix is used as shown in the attached image file.
and this is the spl code: zcalc_priority.spl CODE cr::zcalc_priority(...) { string zmethod; zmethod = "cr::zcalc_priority"; // review of urgency and impact to calc priority // priority = 5, is priority of Critical if ((urgency == 0) && (impact == 5)) { priority = 5; } // priority = 4, is priority of High if (((urgency == 0 ) && (impact == 4)) || ((urgency == 0 ) && (impact == 3)) || ((urgency == 1 ) && (impact == 5)) || ((urgency == 1 ) && (impact == 4)) || ((urgency == 2 ) && (impact == 5))) {priority = 4;} // priority =3, is priority of Medium if (((urgency == 0) && (impact == 2)) || ((urgency == 1) && (impact == 3)) || ((urgency == 1) && (impact == 2)) || ((urgency == 2) && (impact == 4)) || ((urgency == 2) && (impact == 3)) || ((urgency == 3) && (impact == 5)) || ((urgency == 3) && (impact == 4))) {priority = 3;} // priority = 2, is priority of Low if (((urgency == 2) && (impact == 2)) || ((urgency == 3) && (impact == 3)) || ((urgency == 3) && (impact == 2))) {priority = 2;} } and the related mod file: zcalc_priority.mod CODE MODIFY cr POST_VALIDATE zcalc_priority() 101; I hope that is helpful. 'Breeze
Attached File(s)
-------------------- "No matter where you go, there you are."
TAoBB:AtED |
|
|
|
Jul 7 2008, 09:21 AM
Post
#3
|
|
![]() Level 8 Contributor ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Root Admin Posts: 2,413 Joined: 7-January 08 From: Illinois, US Member No.: 2 |
I like your matrix shadowbreeze. I updated the script based on your matrix.
-------------------- While I certainly appreciate the confidence that many SDU members have in my Service Desk abilities, I ask that you please refrain from messaging me directly to address your issues. Please share your issue with the community and allow the community to assist you in a resolution.
|
|
|
|
Jul 23 2008, 10:41 AM
Post
#4
|
|
|
Level 3 Contributor ![]() ![]() ![]() Group: Members Posts: 31 Joined: 4-March 08 Member No.: 415 |
I am trying to setup the spel code to set priority based off of impact and urgency, as found here
I think I understand everything, however things are not working for me. I put the spl file in the majic directory I made the change to cr table for the site defined trigger stopped the service pdm_publish from the command prompt When I ran pdm_publish it told me that it couldn't find anything to publish, so I started up the service and when I tried to start service desk it just sat there, continually loading, but not loading the page. Then I removed the site defined trigger and tried the same thing with a mod file, putting it in the majic directory, again, the same thing happened I changed the code in the file on the first line from cr::zmyscript(...){ to cr::zpriority(...){ I did the same thing in the trigger and the mod file. Can anyone offer any advice as to what I'm doing wrong? |
|
|
|
Jul 23 2008, 10:50 AM
Post
#5
|
|
![]() Level 5 Contributor ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 225 Joined: 6-February 08 From: Austin TX Member No.: 50 |
If you used a mod file rather than adding the trigger through WSP there wouldn't be anything to publish. The function name in the spl file must match the function name the trigger is calling so, if its zpriority() in the mod, it must be cr:zpriority(...) in the spl file.
As to the hang, it sounds like something is wrong with either the mod or spl file. First place I would check is the stdlog. When writing spl it can be useful to debug (it will usually log which line it bombed out on). Also, if you could post your mod and spl code we could probably help you troubleshoot it. Thanks. -------------------- Warning: The Bassmaster General has determined that coffee is good for your health.
|
|
|
|
Jul 23 2008, 11:24 AM
Post
#6
|
|
|
Level 3 Contributor ![]() ![]() ![]() Group: Members Posts: 31 Joined: 4-March 08 Member No.: 415 |
Here is the spl code.
CODE cr::zpriority(...){ int z_pri; if ((urgency == 0) && (impact == 5)) {z_pri = 5; } // priority = 4, is priority of High if (((urgency == 0) && (impact == 4)) || ((urgency == 0) && (impact == 3)) || ((urgency == 1) && (impact == 5)) || ((urgency == 1) && (impact == 4)) || ((urgency == 2) && (impact == 5))) {z_pri = 4;} // priority =3, is priority of Medium if (((urgency == 0) && (impact == 2)) || ((urgency == 1) && (impact == 3)) || ((urgency == 1) && (impact == 2)) || ((urgency == 2) && (impact == 4)) || ((urgency == 2) && (impact == 3)) || ((urgency == 3) && (impact == 5)) || ((urgency == 3) && (impact == 4))) {z_pri = 3;} // priority = 2, is priority of Low if (((urgency == 2) && (impact == 2)) || ((urgency == 3) && (impact == 3)) || ((urgency == 3) && (impact == 2))) {z_pri = 2;} } send_wait(0, this, "call_attr", "priority", "set_val", z_pri, "SURE_SET"); if (msg_error()) { logf(ERROR, "error setting priority to %s on %s %s - %s", z_pri, type.sym, ref_num, msg[0]); return; } else { logf(SIGNIFICANT, "successfully set priority to %s on %s %s", z_pri, type.sym, ref_num); } } here is the .mod CODE OBJECT cr {
TRIGGERS { POST_VALIDATE zpriority() 111 FILTER(EVENT("INSERT") || (impact{} || urgency{})); }; }; This post has been edited by Jeremy: Jul 23 2008, 11:29 AM |
|
|
|
Jul 23 2008, 11:45 AM
Post
#7
|
|
![]() Level 8 Contributor ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Root Admin Posts: 2,413 Joined: 7-January 08 From: Illinois, US Member No.: 2 |
There was one too many close brackets in the script. I have updated the article. This will resolve your issue Jeremy.
-------------------- While I certainly appreciate the confidence that many SDU members have in my Service Desk abilities, I ask that you please refrain from messaging me directly to address your issues. Please share your issue with the community and allow the community to assist you in a resolution.
|
|
|
|
Aug 11 2008, 07:32 AM
Post
#8
|
|
|
Level 3 Contributor ![]() ![]() ![]() Group: Members Posts: 31 Joined: 4-March 08 Member No.: 415 |
That worked for me, thanks alot. I do have a question though, about how people have handled "extra" impacts and Urgencies.
For the Matrix we are using, we use 4 Urgencies and 3 Impacts. that leaves some extra impact/urgency selections that we don't use. I tried to remove them or make them inactive, but that doesn't work. What would you all suggest as far as getting them off the screen... I don't care if they exist, but I want them invisible to technicians. Thanks, |
|
|
|
Aug 11 2008, 09:34 AM
Post
#9
|
|
![]() Level 8 Contributor ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Root Admin Posts: 2,413 Joined: 7-January 08 From: Illinois, US Member No.: 2 |
Please post your follow-up question in a new thread not associated with this wiki article.
-------------------- While I certainly appreciate the confidence that many SDU members have in my Service Desk abilities, I ask that you please refrain from messaging me directly to address your issues. Please share your issue with the community and allow the community to assist you in a resolution.
|
|
|
|
Jun 4 2009, 02:10 PM
Post
#10
|
|
|
Level 4 Contributor ![]() ![]() ![]() ![]() Group: Members Posts: 51 Joined: 25-February 08 From: Panamá Member No.: 190 |
Hi please I need to make something similar but calculating the severity based on impact and priority. Can I use the same script but changing the fields?
-------------------- Regards
SMM |
|
|
|
May 31 2010, 10:30 PM
Post
#11
|
|
|
Level 5 Contributor ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 150 Joined: 21-January 09 From: Abu Dhabi Member No.: 1,343 |
Hi iam using the similar code in issue i have createda field called as zurgency SREL with urgency and the code is below
zmyscript1.spl iss::zmyscript1(...){ int z_pri; if ((zurgency == 0) && (impact == 5)) {z_pri = 5;} // priority = 4, is priority of High if (((zurgency == 0) && (impact == 4)) || ((zurgency == 0) && (impact == 3)) || ((zurgency == 1) && (impact == 5)) || ((zurgency == 1) && (impact == 4)) || ((zurgency == 2) && (impact == 5))) {z_pri = 4;} // priority =3, is priority of Medium if (((zurgency == 0) && (impact == 2)) || ((zurgency == 1) && (impact == 3)) || ((zurgency == 1) && (impact == 2)) || ((zurgency == 2) && (impact == 4)) || ((zurgency == 2) && (impact == 3)) || ((zurgency == 3) && (impact == 5)) || ((zurgency == 3) && (impact == 4))) {z_pri = 3;} // priority = 2, is priority of Low if (((zurgency == 2) && (impact == 2)) || ((zurgency == 3) && (impact == 3)) || ((zurgency == 3) && (impact == 2))) {z_pri = 2;} send_wait(0, this, "call_attr", "priority", "set_val", z_pri, "SURE_SET"); if (msg_error()) { logf(ERROR, "error setting priority to %s on %s %s - %s", z_pri, type.sym, ref_num, msg[0]); return; } else { logf(SIGNIFICANT, "successfully set priority to %s on %s %s", z_pri, type.sym, ref_num); } } trigger: POST_VALIDATE zmyscript1() 111 FILTER(EVENT("INSERT") || (impact{} || zurgency{})); iam getting an error called as "create checkin of iss:400001 failed: AHD03066: Unknown name" can any one help me on this regards farooq |
|
|
|
Jul 14 2010, 06:39 AM
Post
#12
|
|
|
Newbie ![]() Group: Members Posts: 2 Joined: 1-September 09 Member No.: 1,942 |
Has anyone had any problems with the trigger code having adverse affects to Service Desk if you take out the script? In essence, if you put the script in the folder and put in the trigger code, and then remove the script, does the trigger negatively affect Service Desk (prevent the ticket from closing, error messages, etc.).
Also, has anyone had any issues using this scripts and then upgrading to r12.5? I know r12.5 has this feature to auto-calculate Priority and may have impacts to this code. Any information would be great; thanks in advance. |
|
|
|
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:





Jul 7 2008, 05:20 AM












